VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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.
 ~DtUniqueNameGenerator ()
 DTOR.
virtual DtUnicode generateName ()
 Allocate and return a new unique name.
virtual void releaseName (const DtUnicode &name)
 Release a name so that it can be reused.
virtual void takeName (const DtUnicode &name)
 Register a name to not use for generateName()

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

typedef std::set<unsigned int> makVrv::DtUniqueNameGenerator::PostfixList
protected

Constructor & Destructor Documentation

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

CTOR.

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

makVrv::DtUniqueNameGenerator::~DtUniqueNameGenerator ( )

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 Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)