oaNameBase Class Reference

Inheritance diagram for oaNameBase:

oaScalarName oaVectorBitName oaVectorName


Public Methods

 oaNameBase ()
 ~oaNameBase ()
oaBoolean isHier () const
oaBoolean isEmpty () const
oaUInt4 getNumMembers () const
const oaNameMemoperator[] (oaUInt4 i) const
void addHierPath (const oaScalarName &path)
void addHierPath (const oaVectorBitName &path)
void addHierMem (const oaNameSpace &nSpace, const oaChar *in, oaUInt4 len)
void addHierMem (const oaNameMem &in)

Protected Methods

oaUInt4 getSize () const
void resize (oaUInt4 newSize)
void truncate ()

Friends

class oaNameTbl

Detailed Description

The oaNameBase class is an abstract class that includes functions common to Scalar, Vector and VectorBit names. It contains the actual oaNameMem instances that store the strings that comprise a name. For a hierarchical name, it will contain an array of oaNameMems. This class is generally only used directly by code that implements a namespace.


Constructor & Destructor Documentation

oaNameBase::oaNameBase   [inline]
 

This function creates an empty oaNameBase object.

oaNameBase::~oaNameBase   [inline]
 

This function destroys this oaNameBase object and all of its associated data.


Member Function Documentation

void oaNameBase::addHierMem const oaNameMem &    in
 

This function adds a hierarchical member to this name, inserting a copy of in after the existing members that represent a partial hierarchical path, and before the last member, which represents the local name. An exception is thrown if this name is empty.

Parameters:
in The member to be added
Exceptions:
oacInvalidName 

void oaNameBase::addHierMem const oaNameSpace &    nSpace,
const oaChar *    in,
oaUInt4    len
 

This function adds the given string as a member of the hierarchical portion of this name. An exception is thrown if this name is empty.

The in string must not contain any hierarchy delimiters. Only len characters of in are considered. An exception is thrown if this name is empty.

Parameters:
nSpace The nameSpace in which to evaluate the given string
in The input string to add to the hierarchy of this name
len The length of the specified input string
Exceptions:
oacInvalidName 

void oaNameBase::addHierPath const oaVectorBitName &    path
 

This function prepends a hierarchical path to this name. An exception is thrown if this name is empty.

Parameters:
path The path to add
Exceptions:
oacInvalidName 

void oaNameBase::addHierPath const oaScalarName &    path
 

This function prepends a hierarchical path to this name. An exception is thrown if this name is empty.

Parameters:
path The path to add
Exceptions:
oacInvalidName 

oaUInt4 oaNameBase::getNumMembers   const [inline]
 

This function returns the number of members in this oaNameBase object. A name will have more than one member if it has hierarchical delimiters.

oaUInt4 oaNameBase::getSize   const [inline, protected]
 

This function returns the number of oaNameMem objects allocated for this oaNameBase object.

oaBoolean oaNameBase::isEmpty   const [inline]
 

This function returns a boolean value that indicates if this oaNameBase object is empty.

oaBoolean oaNameBase::isHier   const [inline]
 

This function returns a boolean value that indicates if this oaNameBase object is hierarchical (has more than one name member).

const oaNameMem & oaNameBase::operator[] oaUInt4    i const [inline]
 

This function implements the index operator for this oaNameBase object, returning the name member at position i. You cannot modify the name member.

void oaNameBase::resize oaUInt4    newSize [protected]
 

This function resizes the size of the storage in this oaNameBase object to newSize oaNameMembers.

void oaNameBase::truncate   [inline, protected]
 

This function sets the number of name members to zero, truncating the name.


Friends And Related Function Documentation

friend class oaNameTbl [friend]
 

Reimplemented in oaScalarName, oaVectorBitName, and oaVectorName.


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

Return to top of page