oaNameSpace Class Reference

Inheritance diagram for oaNameSpace:

oaCdbaNS oaLefNS oaNativeNS oaSpefNS oaSpfNS oaSpiceNS oaUnixNS oaVerilogNS oaVhdlNS oaWinNS


Public Methods

virtual ~oaNameSpace ()
virtual oaBoolean isEqual (const oaScalarName &n1, const oaScalarName &n2) const=0
virtual oaBoolean isEqual (const oaVectorName &n1, const oaVectorName &n2) const=0
virtual oaBoolean isEqual (const oaVectorBitName &n1, const oaVectorBitName &n2) const=0
virtual oaBoolean isEqual (const oaBundleName &n1, const oaBundleName &n2) const=0
virtual oaBoolean isEqual (const oaSimpleName &n1, const oaSimpleName &n2) const=0
virtual oaBoolean isEqual (const oaName &n1, const oaName &n2) const=0
virtual oaBoolean isEqual (const oaNameMem &n1, const oaNameMem &n2) const=0
virtual oaNameType getType (const oaChar *in) const=0
virtual void getInternalMember (const oaChar *in, oaString &out, oaBoolean &caseSensitive, oaUInt4 len, oaUInt4 flags=0) const=0
virtual void getInternalScalar (const oaChar *in, oaScalarName &out) const=0
virtual void getInternalVBit (const oaChar *in, oaVectorBitName &out, oaBoolean baseOnly=false) const
virtual void getInternalVector (const oaChar *in, oaVectorName &out, oaBoolean baseOnly=false) const
virtual void getInternalBundle (const oaChar *in, oaBundleName &out) const
virtual void getMember (const oaChar *in, oaBoolean caseSensitive, oaString &out, oaUInt4 &loc, oaUInt4 flags=0) const=0
virtual void getMemberArray (const oaNameMem *in, oaUInt4 numMembers, oaString &out, oaUInt4 &loc) const
virtual void getScalarName (const oaScalarName &in, oaString &out, oaUInt4 &loc) const=0
virtual void getVectorName (const oaVectorName &in, oaString &out, oaUInt4 &loc) const
virtual void getVectorBitName (const oaVectorBitName &in, oaString &out, oaUInt4 &loc) const
virtual void getVectorBitName (const oaNameMem *in, oaUInt4 numMembers, oaUInt4 start, oaString &out, oaUInt4 &loc) const
virtual void getBundleName (const oaBundleName &in, oaString &out, oaUInt4 &loc) const
virtual void getSimpleName (const oaSimpleName &in, oaString &out, oaUInt4 &loc) const
virtual void get (const oaByte *data, oaString &out, oaUInt4 &loc) const=0

Protected Methods

virtual oaBoolean isEqual (const oaVectorName &n1, const oaVectorBitName &n2) const=0
void decodeChar (const oaChar *str, oaChar &out, oaUInt2 &shift) const
void encodeChar (oaChar *str, oaChar delimiter, oaChar c) const
void writeChar (oaString &str, oaUInt4 &index, oaChar val) const
void writeInt (oaString &str, oaUInt4 &index, int val) const
oaUInt4 getUInt (const oaChar *&str) const
oaUInt4 getUInt (const oaChar *str, oaUInt4 &end) const
oaUInt4 readUInt4 (const oaByte *data, oaUInt4 &loc) const
const char * readStr (const oaByte *data, oaUInt4 &loc) const
oaBoolean isInternalNormalChar (oaChar c) const
oaBoolean isInternalBusChar (oaChar c) const
oaBoolean isInternalHexDelimiter (oaChar c) const

Friends

class oaNameBase
class oaScalarName
class oaVectorName
class oaVectorBitName
class oaBundleName
class oaSimpleName
class oaName

Detailed Description

A name space refers to a set of rules for creating and interpreting legal names within an application. The oaNameSpace utility class is an abstract base class for defining the name spaces used in name mapping. In conjunction with the oaName object, derived oaNameSpace classes facilitate mapping names to and from the internal representation of a name. See the Name Mapping Section of the Programmer's Guide for more information about mapping names between different namespaces.

Functions for oaNameSpace are not used by the normal application code. The functions are only used by the developers creating their own name space. To create your own name space, create a class derived from oaNameSpace and implement the virtual functions in oaNameSpace that require non-default behavior for your own name space. These functions have default implementations on the oaNameSpace class itself, and the defaults described here are appropriate for some name spaces.

All namespaces apply to external representations of names. Names have an internal representation that is not simply a string. This internal format uses the oaNative name space for portions of the name. Thus, when implementing a new derived name space, you need to determine how to translate names from your original language to the desired output names in the oaNative name space, and vice versa. Since any name handed to a name space is in internal format, the derived name space just needs to provide a translation from oaNative to their name space, and from their name space to oaNative. Once this is implemented, names in the new derived name space can be mapped to any other derived name space.

When a name space receives a name from the database, the name is stored in a tighly packed byte array for efficiency. The oaNameSpace class provides utility functions such as readUInt4() and readStr() to help interpret this byte array. A derived name space must implement the get() function which reads in the byte array and maps it to an output string in the derived name space.

See Deriving Your Own Namespace Section of the Programmer's Guide for more information.


Constructor & Destructor Documentation

oaNameSpace::~oaNameSpace   [inline, virtual]
 

This function is the default destructor for the oaNameSpace class.


Member Function Documentation

void oaNameSpace::decodeChar const oaChar *    str,
oaChar &    out,
oaUInt2 &    shift
const [inline, protected]
 

This utility function is for decoding hex encoded characters found in names. This function is used by the derived name spaces as a utility to help implement the functions that map to and from the native name space. When a name contains a character that is illegal in the name space to which it is being mapped (even in any escaped form that name space may have), the name mapping algorithm uses character encoding to map the names. Characters that are illegal in the destination name space are replaced with a hex delimiter followed by the character value encoded as two hexadecimal digits. This function can be used to decode the hex value that represents the illegal character.

Parameters:
str The input hex encoded string
out The output decoded character
shift The number of characters in the string that were used to encode the character

void oaNameSpace::encodeChar oaChar *    str,
oaChar    delimiter,
oaChar    c
const [inline, protected]
 

This utility function is for hex encoding characters that have special meaning and cannot be represented in certain names. Characters are encoded as the hex delimiter specified followed by the characters hex value. This function is for use by derived name spaces as a utility to help implement the functions that map to and from the native name space.

Parameters:
str The output string representing the encoded character
delimiter The hex delimiter character to use to encode
c The character to encode

void oaNameSpace::get const oaByte *    data,
oaString &    out,
oaUInt4 &    loc
const [pure virtual]
 

This function returns in the string out, beginning at the location loc, the input data block data mapped into this name space. For efficiency, when the database hands a name to the name space, the name is packed into a byte array with a predefined format. This avoids the overhead of allocating a name object in order to map the name to the destination name space. The get() function in the derived name space translates this byte array into a string mapped in the destination name space. More information on the format for the data byte array is available in the Programmers Guide topic, 'Deriving Your Own NameSpace'.

Note: This is a pure virtual function, defined but not implemented in oaNameSpace. Classes derived from oaNameSpace must define this function in order to be instantiated.

Parameters:
data The block of data representing a name in the native name space format
out The value of the input name data in this name space
loc The location in out at which the function starts writing

void oaNameSpace::getBundleName const oaBundleName &    in,
oaString &    out,
oaUInt4 &    loc
const [virtual]
 

This function returns in the string out, beginning at the location loc, the input bundle name in mapped into this name space. It is assumed the input name is in the native name space format. Derived name spaces that support bundle names should reimplement this function.

Parameters:
in The input bundle name in the native name space format
out The string value of the input name in this name space
loc The location in out at which the function starts writing
Exceptions:
oacBundleNameInvalid 

void oaNameSpace::getInternalBundle const oaChar *    in,
oaBundleName &    out
const [virtual]
 

This function returns in out, the input string mapped into the internal name space. Derived name spaces that support bundle names should reimplement this function.

Parameters:
in The input string representing a bundle name in this name space
out The output bundle name object created from mapping input string into the native name space
Exceptions:
oacBundleNameInvalid 

void oaNameSpace::getInternalMember const oaChar *    in,
oaString &    out,
oaBoolean &    caseSensitive,
oaUInt4    len,
oaUInt4    flags = 0
const [pure virtual]
 

This function returns in out, the input string mapped into the internal name space. The len characters of the input string are evaluated. The default is to evaluate the entire string.

Note: This is a pure virtual function, defined but not implemented in oaNameSpace. Classes derived from oaNameSpace must define this function in order to be instantiated.

Parameters:
in The input string representing a name member in this name space
out The output name member object created from mapping input string into the native name space
caseSensitive Determines if the string is case sensitive
len The number of characters of in to evaluate
flags Has no valid values other than 0 in this name space

void oaNameSpace::getInternalScalar const oaChar *    in,
oaScalarName &    out
const [pure virtual]
 

This function returns in out, the input string mapped into the internal name space.

Note: This is a pure virtual function, defined but not implemented in oaNameSpace. Classes derived from oaNameSpace must define this function in order to be instantiated.

Parameters:
in The input string representing a scalar name in this name space
out The output scalar name object created from mapping input string into the native name space

void oaNameSpace::getInternalVBit const oaChar *    in,
oaVectorBitName &    out,
oaBoolean    baseOnly = false
const [virtual]
 

This function returns in out, the input string mapped into the internal name space. If the value of baseOnly is false, the string is interpreted as an entire vector bit name. If the value is true, in is interpreted as the base of the vector bit name. Derived name spaces that support indexed names should reimplement this function.

Parameters:
in The input string representing a vector base name in this name space
out The output vector bit name object created from mapping input string into the native name space
baseOnly Determines if the input string is an entire vectorbit name or just the base value
Exceptions:
oacIndexedNameInvalid 

void oaNameSpace::getInternalVector const oaChar *    in,
oaVectorName &    out,
oaBoolean    baseOnly = false
const [virtual]
 

This function returns in out, the input string mapped into the internal name space. If the value of baseOnly is false, the string is interpreted as an entire vector name. If the value is true, in is interpreted as the base of the vector bit name. Derived name spaces that support vector names should reimplement this function.

Parameters:
in The input string representing a vector name in this name space
out The output vector name object created from mapping input string into the native name space
baseOnly Determines if the input string is an entire vector name or just the base value
Exceptions:
oacVectorNameInvalid 

Reimplemented in oaLefNS, and oaDefNS.

void oaNameSpace::getMember const oaChar *    in,
oaBoolean    caseSensitive,
oaString &    out,
oaUInt4 &    loc,
oaUInt4    flags = 0
const [pure virtual]
 

This function returns in the string out, at the location loc, the input name member in with case sensitivity value caseSensitive mapped into this name space. It is assumed that the input name is in the native name space format.

Note: This is a pure virtual function, defined but not implemented in oaNameSpace. Classes derived from oaNameSpace must define this function in order to be instantiated.

Parameters:
in The input name member in the native name space format
caseSensitive The case sensitivity value of the input name member
out The string value of the input name in this name space
loc The location in out at which the function starts writing
flags Has no valid values other than 0 in this name space

void oaNameSpace::getMemberArray const oaNameMem *    in,
oaUInt4    numMembers,
oaString &    out,
oaUInt4 &    loc
const [virtual]
 

This function returns in the string out, at the location loc, the input name member array in, mapped into this name space. It is assumed the array has numMembers elements and the input name is in the internal name space format. Derived name spaces that support hierarchical names should reimplement this function.

Parameters:
in The input name member array
numMembers The number of members in the input array
out The string value of the input array in this name space
loc The location in out at which the function starts writing
Exceptions:
oacHierNameInvalid 

void oaNameSpace::getScalarName const oaScalarName &    in,
oaString &    out,
oaUInt4 &    loc
const [pure virtual]
 

This function returns in the string out, at the location loc, the input scalar name in mapped into this name space. It is assumed the input name is in the internal namespace format.

Note: This is a pure virtual function, defined but not implemented in oaNameSpace. Classes derived from oaNameSpace must define this function in order to be instantiated.

Parameters:
in The input scalar name
out The string value of the scalar name in this name space
loc The location in out at which the function starts writing

void oaNameSpace::getSimpleName const oaSimpleName &    in,
oaString &    out,
oaUInt4 &    loc
const [virtual]
 

This function returns in the string out, at the location loc, the input simpleName in mapped into this name space. It is assumed the input name is in the internal namespace format. The default implementation calls the correct 'get' function for the type of name the simple name represents: scalar, vector bit, or vector.

Parameters:
in The input simple name
out The string value of the simple name in this name space
loc The location in out at which the function starts writing

oaNameType oaNameSpace::getType const oaChar *    in const [pure virtual]
 

This function returns the type of name represented by the specified string this name space: scalar, vector bit, vector, or bundle. This function does not indicate if the name is valid.

Note: This is a pure virtual function, defined but not implemented in oaNameSpace. Classes derived from oaNameSpace must define this function in order to be instantiated.

Parameters:
in The input string
Returns:
The type of name in represents in this name space

Implemented in oaNativeNS.

oaUInt4 oaNameSpace::getUInt const oaChar *    str,
oaUInt4 &    end
const [protected]
 

This utility function is for reading an integer from the specified string. This function reads the string backwards, starting at the ending index end. The end index is updated to move past the integer and the integer is returned.

Parameters:
str The string from which to read the integer
end The index from which to start reading the string
Exceptions:
oacInvalidNameSyntax 

oaUInt4 oaNameSpace::getUInt const oaChar *&    str const [protected]
 

This utility function is for reading an integer from the specified string. The character pointer is moved past the integer and the integer is returned.

Parameters:
str The string from which to read the integer

void oaNameSpace::getVectorBitName const oaNameMem *    in,
oaUInt4    numMembers,
oaUInt4    start,
oaString &    out,
oaUInt4 &    loc
const [virtual]
 

This function returns in the string out, at the location loc, the input vector bit name in mapped into this name space. It is assumed the array has numMembers elements and is in the internal namespace format. Derived name spaces that support indexed names should reimplement this function.

Parameters:
in The input vector bit name
numMembers The number of members in the input array
start 
out The string value of the vector bit name in this name space
loc The location in out at which the function starts writing
Exceptions:
oacIndexedNameInvalid 

void oaNameSpace::getVectorBitName const oaVectorBitName &    in,
oaString &    out,
oaUInt4 &    loc
const [virtual]
 

This function returns in the string out, at the location loc, the input vector bit name in mapped into this name space. It is assumed the input name is in the internal namespace format. Derived name spaces that support indexed names should reimplement this function.

Parameters:
in The input vector bit name
out The string value of the vector bit name in this name space
loc The location in out at which the function starts writing
Exceptions:
oacIndexedNameInvalid 

void oaNameSpace::getVectorName const oaVectorName &    in,
oaString &    out,
oaUInt4 &    loc
const [virtual]
 

This function returns in the string out, at the location loc, the input vector name in mapped into this name space. It is assumed the input name is in the native name space format. Derived name spaces that support vector names should reimplement this function.

Parameters:
in The input vector name
out The string value of the vector name in this name space
loc The location in out at which the function starts writing
Exceptions:
oacVectorNameInvalid 

Reimplemented in oaLefNS, and oaDefNS.

oaBoolean oaNameSpace::isEqual const oaVectorName &    n1,
const oaVectorBitName &    n2
const [protected, pure virtual]
 

This function returns a boolean value that indicates if the specified vector name and vectorbit name are equal in this name space. Since this function is both overloaded and virtual, derived name spaces need to implement all of the isEqual functions. A default implementation is provided to make this easier.

Parameters:
n1 The first name to check
n2 The second name to check
Exceptions:
oacIndexedNameInvalid 

Implemented in oaLefNS, and oaDefNS.

oaBoolean oaNameSpace::isEqual const oaNameMem &    n1,
const oaNameMem &    n2
const [pure virtual]
 

This function returns a boolean value that indicates if the two specified name members are equal in this name space. Since this function is both overloaded and virtual, derived name spaces needs to implement all of the isEqual functions.

Note: This is a pure virtual function, defined but not implemented in oaNameSpace. Classes derived from oaNameSpace must define this function in order to be instantiated.

Parameters:
n1 The first name to check
n2 The second name to check

oaBoolean oaNameSpace::isEqual const oaName &    n1,
const oaName &    n2
const [pure virtual]
 

This function returns a boolean value that indicates if the two specified names are equal in this name space. Since this function is both overloaded and virtual, derived name spaces need to implement all of the isEqual functions. A default implementation is provided to make this easier.

Parameters:
n1 The first name to check
n2 The second name to check

Implemented in oaNativeNS.

oaBoolean oaNameSpace::isEqual const oaSimpleName &    n1,
const oaSimpleName &    n2
const [pure virtual]
 

This function returns a boolean value that indicates if the two specified simple names are equal in this name space. Since this function is both overloaded and virtual, derived name spaces need to implement all of the isEqual functions. A default implementation is provided to make this easier.

Parameters:
n1 The first name to check
n2 The second name to check

Implemented in oaNativeNS.

oaBoolean oaNameSpace::isEqual const oaBundleName &    n1,
const oaBundleName &    n2
const [pure virtual]
 

This function returns a boolean value that indicates if the two specified bundle names are equal in this name space. Since this function is both overloaded and virtual, derived name spaces need to implement all of the isEqual functions. A default implementation is provided to make this easier.

Parameters:
n1 The first name to check
n2 The second name to check
Exceptions:
oacBundleNameInvalid 

Implemented in oaNativeNS.

oaBoolean oaNameSpace::isEqual const oaVectorBitName &    n1,
const oaVectorBitName &    n2
const [pure virtual]
 

This function returns a boolean value that indicates if the two specified vector bit names are equal in this name space. Since this function is both overloaded and virtual, derived name spaces need to implement all of the isEqual functions. A default implementation is provided to make this easier.

Parameters:
n1 The first name to check
n2 The second name to check
Exceptions:
oacIndexedNameInvalid 

Implemented in oaNativeNS.

oaBoolean oaNameSpace::isEqual const oaVectorName &    n1,
const oaVectorName &    n2
const [pure virtual]
 

This function returns a boolean value that indicates if the two specified vector names are equal in this name space. Since this function is both overloaded and virtual, derived name spaces need to implement all of the isEqual functions. A default implementation is provided to make this easier.

Parameters:
n1 The first name to check
n2 The second name to check
Exceptions:
oacVectorNameInvalid 

Implemented in oaNativeNS.

oaBoolean oaNameSpace::isEqual const oaScalarName &    n1,
const oaScalarName &    n2
const [pure virtual]
 

This function returns a boolean value that indicates if the two specified scalar names are equal in this name space. Since this function is both overloaded and virtual, derived name spaces need to implement all of the isEqual functions.

Note: This is a pure virtual function, defined but not implemented in oaNameSpace. Classes derived from oaNameSpace must define this function in order to be instantiated.

Parameters:
n1 The first name to check
n2 The second name to check

Implemented in oaNativeNS.

oaBoolean oaNameSpace::isInternalBusChar oaChar    c const [inline, protected]
 

This function returns a boolean value that indicates if the character specified is a bus character in the native name space. This function is for use by derived name spaces as a utility to help implement the functions that map to and from the native name space.

Parameters:
c The character to check

oaBoolean oaNameSpace::isInternalHexDelimiter oaChar    c const [inline, protected]
 

This function returns a boolean value that indicates if the character specified is the hex delimiter for the native name space. This function is for use by derived name spaces as a utility to help implement the functions that map to and from the native name space.

Parameters:
c The character to check

oaBoolean oaNameSpace::isInternalNormalChar oaChar    c const [inline, protected]
 

This function returns a boolean value that indicates if the character specified is 'normal' in the native name space. Normal characters are acceptable in names as is, and do not need hex encoding. Characters with special meaning, such as bus characters, are not normal characters. This function is for use by derived name spaces as a utility to help implement the functions that map to and from the native name space.

Parameters:
c The character to check

const char * oaNameSpace::readStr const oaByte *    data,
oaUInt4 &    loc
const [inline, protected]
 

This utility function reads string values from the specified byte array. The loc value is moved past the value returned. This function can be used by derived name spaces in the 'get' function to interpret the byte array that is passed in to the derived name space.

Parameters:
data The string values to read
loc The value moved past the value returned

oaUInt4 oaNameSpace::readUInt4 const oaByte *    data,
oaUInt4 &    loc
const [inline, protected]
 

This utility function reads integer values from the specified byte array. The loc value is moved past the value returned. This function can be used by derived name spaces in the 'get' function to interpret the byte array that is passed in to the derived name space.

Parameters:
data The integer values to read
loc The value moved past the value returned

void oaNameSpace::writeChar oaString &    str,
oaUInt4 &    index,
oaChar    val
const [inline, protected]
 

This utility function is for writing characters to the string str at the specified index. The index is moved past the value written and the NULL terminator is appended. The string str is resized if necessary.

Parameters:
str The string to write
index The location in the string to write the value
val The character to write

void oaNameSpace::writeInt oaString &    str,
oaUInt4 &    index,
int    x
const [protected]
 

This utility function is for writing integers to the string str at the specified index. The index is moved past the value written and the NULL terminator is appended. The string str is resized if necessary.

Parameters:
str The string to write
index The location in the string to write the value
x The integer to write


Friends And Related Function Documentation

friend class oaBundleName [friend]
 

friend class oaName [friend]
 

friend class oaNameBase [friend]
 

friend class oaScalarName [friend]
 

friend class oaSimpleName [friend]
 

friend class oaVectorBitName [friend]
 

friend class oaVectorName [friend]
 


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

Return to top of page