Track::UniqueIdentifier Class Reference

Class that gives its instances unique names. More...

#include <UniqueIdentifier.h>

Inheritance diagram for Track::UniqueIdentifier:

Track::PathEdge Track::PathVertex Track::TrackAttachment Track::StartingPosition Track::TrackBooster List of all members.

Public Member Functions

 UniqueIdentifier ()
 Create an object with a name unique to objects of the same class.
unsigned long int get_name () const
 Get the assigned name.

Private Attributes

unsigned long int my_name
 name assigned to this object

Detailed Description

Class that gives its instances unique names.

It is used instead of pointers so that an object may be moved, copied, freed and reallocated and the names should act intelligently, for example in undo / redo names are preserved, but in copy / paste they are not.

When you copy-construct or assign a UniqueIdentifier instance, the source object's name is kept. This is useful for operations such as undo and redo, where a copy of a previously deleted object can be put back with the same name. However, sometimes a new name is wanted (for example when copy / paste is used, or you are creating a new object similar to a previous one and you want to keep using both copys.) In this case, make sure to use the default constuctor instead of the copy constructor (you may need a special constuctor).

Definition at line 32 of file UniqueIdentifier.h.

Constructor & Destructor Documentation

Track::UniqueIdentifier::UniqueIdentifier (  )  [inline]

Create an object with a name unique to objects of the same class.

Definition at line 36 of file UniqueIdentifier.h.

Member Function Documentation

unsigned long int Track::UniqueIdentifier::get_name (  )  const [inline]

Get the assigned name.

Definition at line 43 of file UniqueIdentifier.h.

Member Data Documentation

unsigned long int Track::UniqueIdentifier::my_name [private]

name assigned to this object

Definition at line 49 of file UniqueIdentifier.h.

The documentation for this class was generated from the following file:
Get Racer at Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:19 2010 by Doxygen version 1.4.7 for Racer version svn335.