VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Types | Protected Attributes
makVrv::DtUniqueNameGenerator Class Reference

Generator for unique names with a specified prefix. More...

Public Member Functions

 DtUniqueNameGenerator (const DtUnicode &prefix)
 CTOR. More...
 
virtual ~DtUniqueNameGenerator ()
 DTOR. More...
 
virtual DtUnicode generateName ()
 Allocate and return a new unique name. More...
 
virtual void releaseName (const DtUnicode &name)
 Release a name so that it can be reused. More...
 
virtual void takeName (const DtUnicode &name)
 Register a name to not use for generateName() More...
 

Protected Types

typedef std::set< unsigned intPostfixList
 

Protected Attributes

DtUnicode myPrefix
 
PostfixList myAllocatedPostfixes
 
unsigned int myNextPostfix
 

Detailed Description

Generator for unique names with a specified prefix.

For example, "sensor_0", "sensor_1", "sensor_2", and so on.

Member Typedef Documentation

Constructor & Destructor Documentation

makVrv::DtUniqueNameGenerator::DtUniqueNameGenerator ( const DtUnicode prefix)

CTOR.

Constructs a name generator that will build names starting with the specified prefix

virtual makVrv::DtUniqueNameGenerator::~DtUniqueNameGenerator ( )
virtual

DTOR.

Member Function Documentation

virtual DtUnicode makVrv::DtUniqueNameGenerator::generateName ( )
virtual

Allocate and return a new unique name.

To allow the name to be reused, call release() on it

virtual void makVrv::DtUniqueNameGenerator::releaseName ( const DtUnicode name)
virtual

Release a name so that it can be reused.

virtual void makVrv::DtUniqueNameGenerator::takeName ( const DtUnicode name)
virtual

Register a name to not use for generateName()

For example, if an object already exists with the name "sensor_2", calling takeName("sensor_2") means that generateName() will generate the sequence "sensor_1", "sensor_3", "sensor_4", and so on.

Member Data Documentation

DtUnicode makVrv::DtUniqueNameGenerator::myPrefix
protected
PostfixList makVrv::DtUniqueNameGenerator::myAllocatedPostfixes
protected
unsigned int makVrv::DtUniqueNameGenerator::myNextPostfix
protected

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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)