torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::physical::Config Class Reference

Configuration. A {name:value} pair. More...

#include <Config.hpp>

+ Inheritance diagram for torc::physical::Config:
+ Collaboration diagram for torc::physical::Config:

Public Member Functions

 Config (void)
 Null constructor required by collections. More...
 
 Config (const string &inName, const string &inValue)
 Standard constructor. More...
 
const stringgetValue (void) const
 Return the configuration value. More...
 
SequenceIndex getOrder (void) const
 Return the configuration sequence index. More...
 
void setValue (const string &inValue)
 Set the configuration value. More...
 
void setName (const string &inName)
 Sets the object name. More...
 
bool operator== (const Config &rhs) const
 Comparison operator. More...
 
const stringgetName (void) const
 Returns the object name. More...
 
bool operator== (const Named &rhs) const
 Equality operator. More...
 

Protected Types

typedef std::string string
 Imported type name. More...
 

Protected Member Functions

void setOrder (SequenceIndex inOrder)
 Set the sequence index for this configuration. More...
 
 Config (const string &inName, const string &inValue, SequenceIndex inOrder)
 Protected copy constructor. This constructor allows the caller to specify the sequence index. More...
 

Protected Attributes

string mValue
 The configuration setting value. More...
 
SequenceIndex mOrder
 The sequence in which the configuration was created. More...
 
string mName
 The name of the object. More...
 

Static Protected Attributes

static const char * sConfigDefaultName = ""
 Default configuration name. More...
 
static const char * sConfigDefaultValue = "#OFF"
 Default configuration value. More...
 

Friends

class ConfigMap
 The ConfigMap class has direct access to our internals. More...
 
class torc::physical::physical::ConfigUnitTest
 Our unit test has direct access to our internals. More...
 

Detailed Description

Configuration. A {name:value} pair.

Config elements typically live in a ConfigMap, and by inheritance, in Design, Module, Instance, and Net objects. Within a ConfigMap, a setting name acts as a key that points to a Config, together forming the standard {setting:name:value} triplet.

Note
The name mentioned here is a user-specified name stemming from the design. It is not the configuration setting name. For example, in configuration "DFF:blink:#FF", "DFF" is the specified setting, "blink" is the name that the design assigns to the corresponding resource, and "#FF" is the value to which "DFF" is set.

Definition at line 39 of file Config.hpp.

Member Typedef Documentation

typedef std::string torc::physical::Config::string
protected

Imported type name.

Definition at line 48 of file Config.hpp.

Constructor & Destructor Documentation

torc::physical::Config::Config ( const string inName,
const string inValue,
SequenceIndex  inOrder 
)
inlineprotected

Protected copy constructor. This constructor allows the caller to specify the sequence index.

Parameters
inNameThe configuration name. The is a user-specified name, not a setting name.
inValueThe configuration value.
inOrderThe sequence index.

Definition at line 72 of file Config.hpp.

73  : Named(inName), mValue(inValue), mOrder(inOrder) {}
Named(const string &inName)
Constructor which must specify the object name.
Definition: Named.hpp:48
SequenceIndex mOrder
The sequence in which the configuration was created.
Definition: Config.hpp:61
string mValue
The configuration setting value.
Definition: Config.hpp:57
torc::physical::Config::Config ( void  )
inline

Null constructor required by collections.

Definition at line 77 of file Config.hpp.

Named(const string &inName)
Constructor which must specify the object name.
Definition: Named.hpp:48
SequenceIndex mOrder
The sequence in which the configuration was created.
Definition: Config.hpp:61
string mValue
The configuration setting value.
Definition: Config.hpp:57
static const char * sConfigDefaultValue
Default configuration value.
Definition: Config.hpp:53
static const char * sConfigDefaultName
Default configuration name.
Definition: Config.hpp:51
torc::physical::Config::Config ( const string inName,
const string inValue 
)
inline

Standard constructor.

Parameters
inNameThe configuration name. The is a user-specified name, not a setting name.
inValueThe configuration value.

Definition at line 82 of file Config.hpp.

83  : Named(inName), mValue(inValue), mOrder(eSequenceIndexNone) {}
Named(const string &inName)
Constructor which must specify the object name.
Definition: Named.hpp:48
SequenceIndex mOrder
The sequence in which the configuration was created.
Definition: Config.hpp:61
string mValue
The configuration setting value.
Definition: Config.hpp:57

Member Function Documentation

const string& torc::physical::Named::getName ( void  ) const
inlineinherited

Returns the object name.

Definition at line 51 of file Named.hpp.

51 { return mName; }
string mName
The name of the object.
Definition: Named.hpp:43

+ Here is the caller graph for this function:

SequenceIndex torc::physical::Config::getOrder ( void  ) const
inline

Return the configuration sequence index.

Definition at line 88 of file Config.hpp.

88 { return mOrder; }
SequenceIndex mOrder
The sequence in which the configuration was created.
Definition: Config.hpp:61

+ Here is the caller graph for this function:

const string& torc::physical::Config::getValue ( void  ) const
inline

Return the configuration value.

Definition at line 86 of file Config.hpp.

86 { return mValue; }
string mValue
The configuration setting value.
Definition: Config.hpp:57

+ Here is the caller graph for this function:

bool torc::physical::Named::operator== ( const Named rhs) const
inlineinherited

Equality operator.

Definition at line 54 of file Named.hpp.

54 { return mName == rhs.mName; }
string mName
The name of the object.
Definition: Named.hpp:43
bool torc::physical::Config::operator== ( const Config rhs) const
inline

Comparison operator.

Returns
true if specified configuration matches this one in both name and value, or false otherwise.

Definition at line 99 of file Config.hpp.

100  { return mName == rhs.mName && mValue == rhs.mValue; }
string mName
The name of the object.
Definition: Named.hpp:43
string mValue
The configuration setting value.
Definition: Config.hpp:57
void torc::physical::Config::setName ( const string inName)
inline

Sets the object name.

Config names can be changed arbitrarily, but other Named subclasses require more complex semantics to prevent name collisions.

Definition at line 94 of file Config.hpp.

94 { mName = inName; }
string mName
The name of the object.
Definition: Named.hpp:43

+ Here is the caller graph for this function:

void torc::physical::Config::setOrder ( SequenceIndex  inOrder)
inlineprotected

Set the sequence index for this configuration.

Parameters
inOrderThe new sequence index.

Definition at line 65 of file Config.hpp.

65 { mOrder = inOrder; }
SequenceIndex mOrder
The sequence in which the configuration was created.
Definition: Config.hpp:61

+ Here is the caller graph for this function:

void torc::physical::Config::setValue ( const string inValue)
inline

Set the configuration value.

Definition at line 90 of file Config.hpp.

90 { mValue = inValue; }
string mValue
The configuration setting value.
Definition: Config.hpp:57

+ Here is the caller graph for this function:

Friends And Related Function Documentation

friend class ConfigMap
friend

The ConfigMap class has direct access to our internals.

Definition at line 42 of file Config.hpp.

friend class torc::physical::physical::ConfigUnitTest
friend

Our unit test has direct access to our internals.

Definition at line 44 of file Config.hpp.

Field Documentation

string torc::physical::Named::mName
protectedinherited

The name of the object.

Definition at line 43 of file Named.hpp.

SequenceIndex torc::physical::Config::mOrder
protected

The sequence in which the configuration was created.

This is used by the XDL exporter to preserve the original order in cases where multiple configurations exist for the same setting name.

Definition at line 61 of file Config.hpp.

string torc::physical::Config::mValue
protected

The configuration setting value.

Todo:
Consider typing mValue to something like SettingValueString.

Definition at line 57 of file Config.hpp.

const char * torc::physical::Config::sConfigDefaultName = ""
staticprotected

Default configuration name.

Definition at line 51 of file Config.hpp.

const char * torc::physical::Config::sConfigDefaultValue = "#OFF"
staticprotected

Default configuration value.

Definition at line 53 of file Config.hpp.


The documentation for this class was generated from the following files: