Workspace 6.21.5
Public Types | Public Member Functions | Related Functions | List of all members
NumberedObject Class Reference

Defines an object with an ID and index (generally used as a base class). More...

#include <Mesh/DataStructures/numberedobject.h>

Inheritance diagram for NumberedObject:
[legend]

Public Types

enum  {
  flag0 , flag1 , flag2 , flag3 ,
  flag4 , flag5 , flag6 , flag7 ,
  flag8 , flag9 , flag10 , flag11 ,
  flag12 , flag13 , flag14 , flag15
}
 

Public Member Functions

 NumberedObject (long ID)
 Create an object with the specified ID and all flags except isValid not set.
 
void clearFlag (unsigned flag)
 Clear flag. Do not use this to manipulate the isValid flag, since list managers are responsible for that.
 
void copyFlags (const NumberedObject &t)
 
long getID () const
 
long getIndex () const
 
bool isFlagSet (unsigned flag) const
 
bool isValid () const
 
void setFlag (unsigned flag, bool b=true)
 Set flag to b. Do not use this to manipulate the isValid flag, since list managers are responsible for that.
 
void setID (long ID)
 
void setIndex (long i)
 
Deprecated functions
void SetID (long ID)
 
long GetID () const
 
void SetIndex (long i)
 
long GetIndex () const
 
bool IsFlagSet (unsigned flag) const
 
void ClearFlag (unsigned flag)
 
void SetFlag (unsigned flag)
 
void setFlagTo (unsigned flag, bool b=true)
 
void SetFlagTo (unsigned flag, bool b=true)
 
bool IsValid () const
 

Related Functions

(Note that these are not member functions.)

int bitMask (unsigned pos)
 

Detailed Description

Objects of this type are almost always managed by a list manager derived from the NumberedObjectList template class.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Anonymous enum to provide a set of general-purpose flag names. These should not be used by clients. They are reserved for internal use. Old client code used to use them, but such usage should be removed as such opportunities arise.

Enumerator
flag0 

True indicates the object is valid, false means it is ready for garbage collection.

flag1 
flag2 
flag3 
flag4 
flag5 
flag6 
flag7 
flag8 
flag9 
flag10 
flag11 
flag12 
flag13 
flag14 
flag15 

Constructor & Destructor Documentation

◆ NumberedObject()

NumberedObject ( long  ID)
inline

Member Function Documentation

◆ clearFlag()

void clearFlag ( unsigned  flag)
inline

◆ ClearFlag()

void ClearFlag ( unsigned  flag)
inline

◆ copyFlags()

void copyFlags ( const NumberedObject t)
inline

Copies all flag values from t to this object. You should not call this function if t is marked as invalid (ie flag0 is false).

◆ getID()

long getID ( ) const
inline
Returns
The ID of the object.

◆ GetID()

long GetID ( ) const
inline

◆ getIndex()

long getIndex ( ) const
inline
Returns
The index of the object. This is useful for faster list indexing operations.

◆ GetIndex()

long GetIndex ( ) const
inline

◆ isFlagSet()

bool isFlagSet ( unsigned  flag) const
inline
Returns
True if the specified flag is set. Do not use this to test the isValid flag. Use IsInvalid() for that.

◆ IsFlagSet()

bool IsFlagSet ( unsigned  flag) const
inline

◆ isValid()

bool isValid ( ) const
inline
Returns
True if the object is not marked for garbage collection.

◆ IsValid()

bool IsValid ( ) const
inline

◆ SetFlag()

void SetFlag ( unsigned  flag)
inline

◆ setFlag()

void setFlag ( unsigned  flag,
bool  b = true 
)
inline

◆ setFlagTo()

void setFlagTo ( unsigned  flag,
bool  b = true 
)
inline

◆ SetFlagTo()

void SetFlagTo ( unsigned  flag,
bool  b = true 
)
inline

◆ setID()

void setID ( long  ID)
inline
Parameters
IDThe object will get this as its new ID.

◆ SetID()

void SetID ( long  ID)
inline

◆ setIndex()

void setIndex ( long  i)
inline
Parameters
iThe object will get this as its new index.

◆ SetIndex()

void SetIndex ( long  i)
inline

Friends And Related Function Documentation

◆ bitMask()

int bitMask ( unsigned  pos)
related
Returns
The bit mask for position pos of a flag set. Note that pos starts at zero.