MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AbstractHeadlessDriver.h
Go to the documentation of this file.
1 /* -*- mode:C++ -*-
2  AbstractHeadlessDriver.h Base class for all command-line MFM drivers
3  Copyright (C) 2014 The Regents of the University of New Mexico. All rights reserved.
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
18  USA
19 */
20 
27 #ifndef ABSTRACT_HEADLESS_DRIVER_H
28 #define ABSTRACT_HEADLESS_DRIVER_H
29 
30 #include "Logger.h"
31 #include "FileByteSink.h"
32 #include "itype.h"
33 #include "ParamConfig.h"
34 #include "GridConfig.h"
35 #include "CoreConfig.h"
36 #include "Tile.h"
37 #include "Grid.h"
38 #include "ElementTable.h"
39 #include "Element_Empty.h" /* Need common elements */
40 #include "VArguments.h"
41 #include "AbstractDriver.h"
42 
43 namespace MFM
44 {
49  template<class GC>
51  {
52  private: typedef AbstractDriver<GC> Super;
53 
54  protected:
55  typedef typename Super::OurGrid OurGrid;
56  typedef typename Super::CC CC;
57 
59  { }
60 
61  virtual void AddDriverArguments()
62  {
64  }
65 
66  virtual void OnceOnly(VArguments& args)
67  {
68  Super::OnceOnly(args);
69  }
70 
71  virtual void PostUpdate()
72  {
73  LOG.Debug("AEPS: %d", (u32)Super::GetAEPS());
74  }
75  };
76 }
77 
78 #endif /* ABSTRACT_HEADESS_DRIVER_H */
virtual void OnceOnly(VArguments &args)
Definition: AbstractDriver.h:392
virtual void OnceOnly(VArguments &args)
Definition: AbstractHeadlessDriver.h:66
Definition: AbstractDriver.h:67
virtual void PostUpdate()
Definition: AbstractHeadlessDriver.h:71
virtual void AddDriverArguments()
Definition: AbstractDriver.h:912
Definition: AbstractHeadlessDriver.h:50
virtual void AddDriverArguments()
Definition: AbstractHeadlessDriver.h:61
Definition: Grid.h:47
GC::CORE_CONFIG CC
Definition: AbstractDriver.h:75
void Debug(const char *format,...)
Definition: Logger.h:301
Definition: VArguments.h:48