53 #ifndef __SIM_CXX_CONFIG_HH__
54 #define __SIM_CXX_CONFIG_HH__
86 bool isVector_,
bool isSimObject_) :
104 bool isVector_,
bool isMaster_) :
113 std::map<std::string, PortDesc *>
ports;
141 virtual void setName(
const std::string &name_) { }
163 const std::string &value,
const Flags flags)
196 virtual bool getParam(
const std::string &object_name,
197 const std::string ¶m_name,
198 std::string &value)
const = 0;
202 const std::string ¶m_name,
206 virtual bool getPortPeers(
const std::string &object_name,
207 const std::string &port_name,
211 virtual bool objectExists(
const std::string &object_name)
const = 0;
221 bool return_paths =
false)
const = 0;
224 virtual bool load(
const std::string &filename) = 0;
232 extern std::map<std::string, CxxConfigDirectoryEntry *>
239 #endif // __SIM_CXX_CONFIG_HH__
virtual const std::string & getName()
Get full path name string.
const std::string & name()
virtual bool getPortPeers(const std::string &object_name, const std::string &port_name, std::vector< std::string > &peers) const =0
Get the peer (connected) ports of the named ports.
virtual bool setSimObjectVector(const std::string &name, const std::vector< SimObject * > &simObjects)
As setSimObjectVector but set a whole vector of references.
uint32_t FlagsType
Flags passable to setParam...
virtual ~CxxConfigParams()
Base for peer classes of SimObjectParams derived classes with parameter modifying member functions...
const bool isSimObject
Is this a SimObject, and so is to be set with setSimObject...
ParamDesc(const std::string &name_, bool isVector_, bool isSimObject_)
virtual void getObjectChildren(const std::string &object_name, std::vector< std::string > &children, bool return_paths=false) const =0
Get the names or paths of all the children SimObjects of this SimObject.
std::map< std::string, PortDesc * > ports
Ports.
::Flags< FlagsType > Flags
std::map< std::string, CxxConfigDirectoryEntry * > cxx_config_directory
Directory of all SimObject classes config details.
Similar to ParamDesc to describe ports.
void cxxConfigInit()
Initialise cxx_config_directory.
virtual ~CxxConfigFileBase()
virtual bool setParamVector(const std::string &name, const std::vector< std::string > &values, const Flags flags)
As setParamVector but for parameters given as vectors pre-separated into elements.
virtual void setName(const std::string &name_)
Example flag.
virtual bool getParamVector(const std::string &object_name, const std::string ¶m_name, std::vector< std::string > &values) const =0
Get a list/vector parameter.
virtual CxxConfigParams * makeParamsObject() const
Make a ...Param structure for the SimObject class of this entry.
Config file wrapper providing a common interface to CxxConfigManager.
static const std::string invalidName
std::map< std::string, ParamDesc * > parameters
All parameters (including SimObjects) in order.
virtual ~CxxConfigDirectoryEntry()
const bool isMaster
Is this a master or slave port.
virtual bool setParam(const std::string &name, const std::string &value, const Flags flags)
Set a parameter with a value parsed from the given string.
virtual bool objectExists(const std::string &object_name) const =0
Does an object with this path exist?
virtual SimObject * simObjectCreate()
Create the associated SimObject.
virtual bool setPortConnectionCount(const std::string &name, unsigned int count)
Set the number of connections expected for the named port.
virtual bool getParam(const std::string &object_name, const std::string ¶m_name, std::string &value) const =0
Get a single parameter value as a string returned in value.
virtual CxxConfigParams::Flags getFlags() const
Get the flags which should be used to modify parameter parsing behaviour.
virtual bool load(const std::string &filename)=0
Load config file.
Config details entry for a SimObject.
virtual void getAllObjectNames(std::vector< std::string > &list) const =0
Get all SimObjects in the config.
PortDesc(const std::string &name_, bool isVector_, bool isMaster_)
virtual bool setSimObject(const std::string &name, SimObject *simObject)
Set a SimObject valued parameter with a reference to the given SimObject.
Abstract superclass for simulation objects.