Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Xyce::Device::Configuration Class Referenceabstract

Class Configuration contains device configuration data. More...

#include <N_DEV_Configuration.h>

Inheritance diagram for Xyce::Device::Configuration:
Collaboration diagram for Xyce::Device::Configuration:

Public Types

typedef std::map< NameLevelKey,
Configuration *, NameLevelLess
ConfigurationMap
 

Public Member Functions

virtual ~Configuration ()
 
ParametricData< void > & getInstanceParameters () const
 Returns the instance parameter descriptions. More...
 
ParametricData< void > & getModelParameters () const
 Returns the model parameter descriptions. More...
 
const std::string & getName () const
 Returns the device name. More...
 
const std::string & getDeviceTypeName () const
 Returns the device type name. More...
 
const std::string & getInstanceDefaultParameterName () const
 Returns the instance default parameter name. More...
 
int getNumNodes () const
 Returns the number of nodes of this device. More...
 
int getNumOptionalNodes () const
 Returns the number of optional nodes of this device. More...
 
int getNumFillNodes () const
 Returns the number of fill nodes of this device. More...
 
bool getModelRequired () const
 Returns true of the model must be specified when defining an instance of this device. More...
 
bool getLinearDevice () const
 Returns true of the model is a linear device. More...
 
bool getPDEDevice () const
 Returns true of the model is a PDE device. More...
 
const std::string & getPrimaryParameter () const
 Returns the default primary parameter of this device or the empty string if there is no primary parameter. More...
 
const std::vector< std::string > & getModelTypeNames () const
 Returns a vector of strings that name all the model types defined of this model. More...
 
DevicecreateDevice (const FactoryBlock &factory_block) const
 Creates the specified device. More...
 
virtual Devicefactory (const FactoryBlock &factory_block) const =0
 Overriding function creates an instance this device. More...
 
virtual InstanceTypeId instanceType () const =0
 Returns the instance type identifier. More...
 
virtual ModelTypeId modelType () const =0
 Returns the model type identifier. More...
 
virtual ModelTypeId modelGroup () const =0
 Returns the model group identifier. More...
 

Static Public Member Functions

static const ConfigurationMapgetConfigurationMap ()
 Returns the configuration map of the system. More...
 
static const ConfigurationfindConfiguration (ModelTypeId model_type_id)
 Returns the configuration associated with the device name and level or 0 if not found. More...
 
static const ConfigurationfindConfiguration (const std::string &device_name, const int level)
 Returns the configuration associated with the device name and level or 0 if not found. More...
 
static ModelTypeId getModelType (const std::string &model_name, const int level)
 Returns the model type identifier for the specified device, if the model type and level is not found, return an invalid type. More...
 
static ModelTypeId getModelGroup (const std::string &device_name)
 Returns the model group of the device name. More...
 

Protected Member Functions

 Configuration (ParametricData< void > &instance_parameters, ParametricData< void > &model_parameters, const char *name, const char *device_type_name, const char *instance_default_parameter_name, int num_nodes, int num_optional_nodes, int num_fill_nodes, bool model_required, bool linear_device, bool pde_device, const char *primary_parameter)
 Populates the device configuration object. More...
 
void addDevice (const char *model_name, const int model_level, ModelTypeId model_type_id, ModelTypeId model_group_id, int model_type_nodes, int model_group_nodes)
 Adds the device to the configuration. More...
 
void addModel (const char *model_name, const int level, ModelTypeId model_type_id, ModelTypeId model_group_id)
 Adds a model name for the device to the configuration. More...
 

Private Member Functions

 Configuration (const Configuration &)
 No copies allowed. More...
 
Configurationoperator= (const Configuration &)
 No assignment allowed. More...
 

Private Attributes

ParametricData< void > & instanceParameters_
 Reference to the Instance specific parameter map. More...
 
ParametricData< void > & modelParameters_
 Reference to the Model specific parameter map. More...
 
const std::string name_
 Name of the devive. More...
 
const std::string deviceTypeName_
 Type name of the device. More...
 
const std::string instanceDefaultParameterName_
 Default parameter name for the device instance. More...
 
int numNodes_
 Number of nodes of this device. More...
 
int numOptionalNodes_
 Number of optional nodes of this device. More...
 
int numFillNodes_
 Number of fill nodes of this device. More...
 
bool modelRequired_
 True if model is required. More...
 
bool linearDevice_
 True if model is a linear device. More...
 
bool pdeDevice_
 True if model is a PDE device. More...
 
std::string primaryParameter_
 Primary parameter name or the empty string if none. More...
 
std::vector< std::string > modelTypeNames_
 Vector of defined model type of this device's model. More...
 

Detailed Description

Class Configuration contains device configuration data.

The DeviceTraits template describes the device and configuration is an object that holds the data obtained via the traits.

The configuration also maintains several containers that allow device, instance and model data and creation functions to be located by name and level.

Definition at line 332 of file N_DEV_Configuration.h.

Member Typedef Documentation

Constructor & Destructor Documentation

Xyce::Device::Configuration::Configuration ( ParametricData< void > &  instance_parameters,
ParametricData< void > &  model_parameters,
const char *  name,
const char *  device_type_name,
const char *  instance_default_parameter_name,
int  num_nodes,
int  num_optional_nodes,
int  num_fill_nodes,
bool  model_required,
bool  linear_device,
bool  pde_device,
const char *  primary_parameter 
)
inlineprotected

Populates the device configuration object.

Note that the instanceParameters_ and modelParameters_ each reference the instanceParameters__ and modelParameters__ object of the derived Config<Traits> class. This really just keeps that casting down and could be implemented as ParametricData<void> objects here.

Parameters
instance_parameters
model_parameters
name
device_type_name
num_nodes
num_optional_nodes
num_fill_nodes
model_required
primary_parameter

Definition at line 453 of file N_DEV_Configuration.h.

virtual Xyce::Device::Configuration::~Configuration ( )
inlinevirtual

Definition at line 482 of file N_DEV_Configuration.h.

Xyce::Device::Configuration::Configuration ( const Configuration )
private

No copies allowed.

Member Function Documentation

void Xyce::Device::Configuration::addDevice ( const char *  model_name,
const int  model_level,
ModelTypeId  model_type_id,
ModelTypeId  model_group_id,
int  model_type_nodes,
int  model_group_nodes 
)
protected

Adds the device to the configuration.

Invariant
only one device can designate itself as the group lead
device and level must be unique
Parameters
device_nameconst character pointer to the device name
device_leveldevice level
model_type_idmodel type identifier of the device

Definition at line 237 of file N_DEV_Configuration.C.

void Xyce::Device::Configuration::addModel ( const char *  model_name,
const int  level,
ModelTypeId  model_type_id,
ModelTypeId  model_group_id 
)
protected

Adds a model name for the device to the configuration.

Invariant
only one device can designate itself as the group lead
model names must be unique within a device configuration
Parameters
model_nameconst character pointer to the model name
levelmodel level of this model of the device
model_type_idmodel type identifier
model_group_idmode group identifier

Definition at line 289 of file N_DEV_Configuration.C.

Device * Xyce::Device::Configuration::createDevice ( const FactoryBlock factory_block) const

Creates the specified device.

Parameters
model_typemodel type of the device to create
factory_blockparameters provided to the factory function
Returns

Definition at line 186 of file N_DEV_Configuration.C.

virtual Device* Xyce::Device::Configuration::factory ( const FactoryBlock factory_block) const
pure virtual

Overriding function creates an instance this device.

Ownership of this object is passed to the caller which is responsible to destory the created object.

Parameters
factory_blockreference to the parameter block
Returns
pointer to the newly created device.

Implemented in Xyce::Device::Config< T >.

const Configuration * Xyce::Device::Configuration::findConfiguration ( ModelTypeId  model_type_id)
static

Returns the configuration associated with the device name and level or 0 if not found.

Parameters
device_nameconst reference to the device name
leveldevice level
Returns
const pointer to the specified device's configuration

Definition at line 153 of file N_DEV_Configuration.C.

const Configuration * Xyce::Device::Configuration::findConfiguration ( const std::string &  device_name,
const int  level 
)
static

Returns the configuration associated with the device name and level or 0 if not found.

Parameters
device_nameconst reference to the device name
leveldevice level
Returns
const pointer to the specified device's configuration

Definition at line 169 of file N_DEV_Configuration.C.

const Configuration::ConfigurationMap & Xyce::Device::Configuration::getConfigurationMap ( )
static

Returns the configuration map of the system.

The configuration map maps the device name and level pair to its configuration.

Returns
const reference to the device configuration map.

Definition at line 140 of file N_DEV_Configuration.C.

const std::string& Xyce::Device::Configuration::getDeviceTypeName ( ) const
inline

Returns the device type name.

Returns
const reference to the device type name

Definition at line 521 of file N_DEV_Configuration.h.

const std::string& Xyce::Device::Configuration::getInstanceDefaultParameterName ( ) const
inline

Returns the instance default parameter name.

Returns
const reference to the instance default parameter name

Definition at line 530 of file N_DEV_Configuration.h.

ParametricData<void>& Xyce::Device::Configuration::getInstanceParameters ( ) const
inline

Returns the instance parameter descriptions.

Returns
reference to the instance parameter descriptions

Definition at line 494 of file N_DEV_Configuration.h.

bool Xyce::Device::Configuration::getLinearDevice ( ) const
inline

Returns true of the model is a linear device.

Returns
true if the model is a linear deive

Definition at line 578 of file N_DEV_Configuration.h.

EntityTypeId Xyce::Device::Configuration::getModelGroup ( const std::string &  device_name)
static

Returns the model group of the device name.

A device is registered as the model group when its model type identifier equals its model group identifier.

Parameters
device_nameconst reference to the device name
Returns
model group identifier for the specified device

Definition at line 219 of file N_DEV_Configuration.C.

ParametricData<void>& Xyce::Device::Configuration::getModelParameters ( ) const
inline

Returns the model parameter descriptions.

Returns
reference to the model parameter descriptions

Definition at line 503 of file N_DEV_Configuration.h.

bool Xyce::Device::Configuration::getModelRequired ( ) const
inline

Returns true of the model must be specified when defining an instance of this device.

Returns
true if the model must be specified

Definition at line 569 of file N_DEV_Configuration.h.

EntityTypeId Xyce::Device::Configuration::getModelType ( const std::string &  model_name,
const int  level 
)
static

Returns the model type identifier for the specified device, if the model type and level is not found, return an invalid type.

Parameters
model_nameconst reference to the model name
leveldevice level
Returns
the model type identifier for the specified device model

Definition at line 201 of file N_DEV_Configuration.C.

const std::vector<std::string>& Xyce::Device::Configuration::getModelTypeNames ( ) const
inline

Returns a vector of strings that name all the model types defined of this model.

Returns
const reference to the vector of string names of defined model types

Definition at line 605 of file N_DEV_Configuration.h.

const std::string& Xyce::Device::Configuration::getName ( ) const
inline

Returns the device name.

Returns
const reference to the device name

Definition at line 512 of file N_DEV_Configuration.h.

int Xyce::Device::Configuration::getNumFillNodes ( ) const
inline

Returns the number of fill nodes of this device.

Returns
number of fill nodes of this device

Definition at line 560 of file N_DEV_Configuration.h.

int Xyce::Device::Configuration::getNumNodes ( ) const
inline

Returns the number of nodes of this device.

Returns
number of nodes of this device

Definition at line 540 of file N_DEV_Configuration.h.

int Xyce::Device::Configuration::getNumOptionalNodes ( ) const
inline

Returns the number of optional nodes of this device.

Returns
number of optional nodes of this device

Definition at line 550 of file N_DEV_Configuration.h.

bool Xyce::Device::Configuration::getPDEDevice ( ) const
inline

Returns true of the model is a PDE device.

Returns
true if the model is a PDE device

Definition at line 587 of file N_DEV_Configuration.h.

const std::string& Xyce::Device::Configuration::getPrimaryParameter ( ) const
inline

Returns the default primary parameter of this device or the empty string if there is no primary parameter.

Returns
primary parameter for this device.

Definition at line 596 of file N_DEV_Configuration.h.

virtual InstanceTypeId Xyce::Device::Configuration::instanceType ( ) const
pure virtual

Returns the instance type identifier.

Returns
the instance type identifier

Implemented in Xyce::Device::Config< T >.

virtual ModelTypeId Xyce::Device::Configuration::modelGroup ( ) const
pure virtual

Returns the model group identifier.

Returns
the model group identifier

Implemented in Xyce::Device::Config< T >.

virtual ModelTypeId Xyce::Device::Configuration::modelType ( ) const
pure virtual

Returns the model type identifier.

Returns
the model type identifier
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Wed Feb 5 10:08:52 2014

Implemented in Xyce::Device::Config< T >.

Configuration& Xyce::Device::Configuration::operator= ( const Configuration )
private

No assignment allowed.

Member Data Documentation

const std::string Xyce::Device::Configuration::deviceTypeName_
private

Type name of the device.

Definition at line 741 of file N_DEV_Configuration.h.

const std::string Xyce::Device::Configuration::instanceDefaultParameterName_
private

Default parameter name for the device instance.

Definition at line 742 of file N_DEV_Configuration.h.

ParametricData<void>& Xyce::Device::Configuration::instanceParameters_
private

Reference to the Instance specific parameter map.

Definition at line 738 of file N_DEV_Configuration.h.

bool Xyce::Device::Configuration::linearDevice_
private

True if model is a linear device.

Definition at line 747 of file N_DEV_Configuration.h.

ParametricData<void>& Xyce::Device::Configuration::modelParameters_
private

Reference to the Model specific parameter map.

Definition at line 739 of file N_DEV_Configuration.h.

bool Xyce::Device::Configuration::modelRequired_
private

True if model is required.

Definition at line 746 of file N_DEV_Configuration.h.

std::vector<std::string> Xyce::Device::Configuration::modelTypeNames_
private

Vector of defined model type of this device's model.

Definition at line 750 of file N_DEV_Configuration.h.

const std::string Xyce::Device::Configuration::name_
private

Name of the devive.

Definition at line 740 of file N_DEV_Configuration.h.

int Xyce::Device::Configuration::numFillNodes_
private

Number of fill nodes of this device.

Definition at line 745 of file N_DEV_Configuration.h.

int Xyce::Device::Configuration::numNodes_
private

Number of nodes of this device.

Definition at line 743 of file N_DEV_Configuration.h.

int Xyce::Device::Configuration::numOptionalNodes_
private

Number of optional nodes of this device.

Definition at line 744 of file N_DEV_Configuration.h.

bool Xyce::Device::Configuration::pdeDevice_
private

True if model is a PDE device.

Definition at line 748 of file N_DEV_Configuration.h.

std::string Xyce::Device::Configuration::primaryParameter_
private

Primary parameter name or the empty string if none.

Definition at line 749 of file N_DEV_Configuration.h.


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