MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ConfigFunctionCall.h
Go to the documentation of this file.
1 /* -*- mode:C++ -*-
2  ConfigFunctionCall.h Represent a function call that can appear in a config file
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 
28 #ifndef CONFIGFUNCTIONCALL_H
29 #define CONFIGFUNCTIONCALL_H
30 
31 #include "LineCountingByteSource.h"
32 
33 namespace MFM
34 {
35  template<typename> class ExternalConfig;
36 
41  template<class GC>
43  {
44  public:
45  const char * const m_functionName;
46 
47  ConfigFunctionCall(const char * name) :
48  m_functionName(name), m_valid(false)
49  {
50  }
51 
52  bool IsValid()
53  {
54  return m_valid;
55  }
56 
57  const char* GetFunctionName()
58  {
59  return m_functionName;
60  }
61 
62  virtual bool Parse(ExternalConfig<GC> & ec) = 0;
63 
64  virtual void Print(ByteSink & in) = 0;
65 
66  virtual void Apply(ExternalConfig<GC> & ec) = 0;
67 
68  virtual ~ConfigFunctionCall() { }
69 
70  protected:
71  bool m_valid;
72 
79 
85  bool SkipToNextExistingArg(LineCountingByteSource & in, const char * description) ;
86 
87  };
88 }
89 
90 #include "ExternalConfig.h"
91 #include "ConfigFunctionCall.tcc"
92 
93 #endif /* CONFIGFUNCTIONCALL_H */
Definition: ConfigFunctionCall.h:42
Definition: ConfigFunctionCall.h:35
Definition: LineCountingByteSource.h:42
s32 SkipToNextArg(LineCountingByteSource &in)
Definition: ConfigFunctionCall.tcc:31
Definition: ByteSink.h:47
bool SkipToNextExistingArg(LineCountingByteSource &in, const char *description)
Definition: ConfigFunctionCall.tcc:6