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

Devices and models are each named. More...

#include <N_DEV_InstanceName.h>

Public Member Functions

 InstanceName ()
 Creates an empty entity name. More...
 
 InstanceName (const std::string &name)
 Creates an entity. More...
 
InstanceNameoperator= (const InstanceName &entity_name)
 Creates an entity. More...
 
char getDeviceLetter () const
 Return the first letter of the device specification after the subcircuit. More...
 
std::string getDeviceType () const
 Decodes the device type. More...
 
std::string getDeviceName () const
 Decodes the device name. More...
 
std::string getSubcircuitName () const
 Decodes the device name. More...
 
int getNumInputs () const
 For the U device, return the number of inputs which have been encoded into the device name. More...
 
const std::string & getEncodedName () const
 Return the instance name encoded as: [s:]*xname [s:]*Ytype!name [s:]*Utype!name!count. More...
 

Private Member Functions

 InstanceName (char device_letter, const std::string &device_type, const std::string &subcircuit_name, const std::string &device_name, int num_inputs)
 
void decode ()
 
void encode ()
 
char decodeDeviceLetter () const
 
std::string decodeDeviceType () const
 
std::string decodeDeviceName () const
 
std::string decodeSubcircuitName () const
 
int decodeNumInputs () const
 

Private Attributes

char deviceLetter_
 Device letter (Y or U included) More...
 
std::string deviceType_
 Device type from netlist (does NOT include Y or U prefix) More...
 
std::string deviceName_
 Device name from netlist (subcircuit NOT included) More...
 
std::string subcircuitName_
 Device subcircuit from netlist. More...
 
int numInputs_
 Hack for U type device (needs to become a parameter) More...
 
std::string name_
 Complete encoded name. More...
 

Detailed Description

Devices and models are each named.

Models are not encoded, so simple string representation is sufficient. However Devices are a different lot. They are encoded as

[s:]*xname [s:]*Ytype!name [s:]*Utype!name!count

where s is a subciruit name, x is a single letter device type, type is a multiletter device type (no Y or U prefix) and count is a special input count for the U device.

Currently encoded names are accepted and then decoded using the getter's. In the future, these will be stored in component form and then encoded onyl as needed.

Definition at line 83 of file N_DEV_InstanceName.h.

Constructor & Destructor Documentation

Xyce::Device::InstanceName::InstanceName ( char  device_letter,
const std::string &  device_type,
const std::string &  subcircuit_name,
const std::string &  device_name,
int  num_inputs 
)
inlineprivate

Definition at line 86 of file N_DEV_InstanceName.h.

Xyce::Device::InstanceName::InstanceName ( )
inline

Creates an empty entity name.

Definition at line 110 of file N_DEV_InstanceName.h.

Xyce::Device::InstanceName::InstanceName ( const std::string &  name)
inlineexplicit

Creates an entity.

Invariant
Parameters
namemodel or encoded device entity name
Returns

Definition at line 137 of file N_DEV_InstanceName.h.

Member Function Documentation

void Xyce::Device::InstanceName::decode ( )
private

Definition at line 54 of file N_DEV_InstanceName.C.

char Xyce::Device::InstanceName::decodeDeviceLetter ( ) const
private

Definition at line 124 of file N_DEV_InstanceName.C.

std::string Xyce::Device::InstanceName::decodeDeviceName ( ) const
private

Definition at line 87 of file N_DEV_InstanceName.C.

std::string Xyce::Device::InstanceName::decodeDeviceType ( ) const
private

Definition at line 68 of file N_DEV_InstanceName.C.

int Xyce::Device::InstanceName::decodeNumInputs ( ) const
private

Definition at line 134 of file N_DEV_InstanceName.C.

std::string Xyce::Device::InstanceName::decodeSubcircuitName ( ) const
private

Definition at line 114 of file N_DEV_InstanceName.C.

void Xyce::Device::InstanceName::encode ( )
private

Definition at line 64 of file N_DEV_InstanceName.C.

char Xyce::Device::InstanceName::getDeviceLetter ( ) const
inline

Return the first letter of the device specification after the subcircuit.

The device letter is Y or U for multiletter device names or the letter that identifies the device for sinlge letter names.

Returns
single letter associated with the device

Definition at line 193 of file N_DEV_InstanceName.h.

std::string Xyce::Device::InstanceName::getDeviceName ( ) const
inline

Decodes the device name.

The device name is a string containing the first letter for a single letter device name, or the string starting after the Y or U up to but noe including the exclamation point (!).

Subcircuit prefixes are not included.

Returns
string representing the device name

Definition at line 242 of file N_DEV_InstanceName.h.

std::string Xyce::Device::InstanceName::getDeviceType ( ) const
inline

Decodes the device type.

The device type is a string containing the first letter for a single letter device name, or the string starting after the Y or U up to but noe including the exclamation point (!).

Subcircuit prefixes are not included.

Returns
string representing the device type

Definition at line 217 of file N_DEV_InstanceName.h.

const std::string& Xyce::Device::InstanceName::getEncodedName ( ) const
inline

Return the instance name encoded as: [s:]*xname [s:]*Ytype!name [s:]*Utype!name!count.

Returns
encoded instance name

Definition at line 310 of file N_DEV_InstanceName.h.

int Xyce::Device::InstanceName::getNumInputs ( ) const
inline

For the U device, return the number of inputs which have been encoded into the device name.

(These probably should be encoded into the device parameters, not the name.)

Invariant
Returns

Definition at line 289 of file N_DEV_InstanceName.h.

std::string Xyce::Device::InstanceName::getSubcircuitName ( ) const
inline

Decodes the device name.

The device name is a string containing the first letter for a single letter device name, or the string starting after the Y or U up to but noe including the exclamation point (!).

Returns
string representing the device name

Definition at line 265 of file N_DEV_InstanceName.h.

InstanceName& Xyce::Device::InstanceName::operator= ( const InstanceName entity_name)
inline

Creates an entity.

Invariant
Parameters
namemodel or encoded device entity name
Returns

Definition at line 166 of file N_DEV_InstanceName.h.

Member Data Documentation

char Xyce::Device::InstanceName::deviceLetter_
private

Device letter (Y or U included)

Definition at line 326 of file N_DEV_InstanceName.h.

std::string Xyce::Device::InstanceName::deviceName_
private

Device name from netlist (subcircuit NOT included)

Definition at line 328 of file N_DEV_InstanceName.h.

std::string Xyce::Device::InstanceName::deviceType_
private

Device type from netlist (does NOT include Y or U prefix)

Definition at line 327 of file N_DEV_InstanceName.h.

std::string Xyce::Device::InstanceName::name_
private

Complete encoded name.

Definition at line 332 of file N_DEV_InstanceName.h.

int Xyce::Device::InstanceName::numInputs_
private

Hack for U type device (needs to become a parameter)

Definition at line 330 of file N_DEV_InstanceName.h.

std::string Xyce::Device::InstanceName::subcircuitName_
private

Device subcircuit from netlist.

Definition at line 329 of file N_DEV_InstanceName.h.


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