BGC Tools
Public Member Functions | Private Attributes
BGC.Utility.IdManager Class Reference
Collaboration diagram for BGC.Utility.IdManager:
Collaboration graph
[legend]

Public Member Functions

 IdManager ()
 Empty construct that starts ids at 0 More...
 
 IdManager (bool humanFriendlyIds)
 Construct id manager where the ids can either start at 0 or at the lowest possible integer value More...
 
void Reset ()
 Reset starting id to 0 More...
 
int GetId ()
 Get an unused id More...
 

Private Attributes

int count = -1
 

Detailed Description

Definition at line 3 of file IdManager.cs.

Constructor & Destructor Documentation

◆ IdManager() [1/2]

BGC.Utility.IdManager.IdManager ( )
inline

Empty construct that starts ids at 0

Definition at line 10 of file IdManager.cs.

10 { }

◆ IdManager() [2/2]

BGC.Utility.IdManager.IdManager ( bool  humanFriendlyIds)
inline

Construct id manager where the ids can either start at 0 or at the lowest possible integer value

Parameters
humanFriendlyIds

Definition at line 17 of file IdManager.cs.

18  {
19  if (humanFriendlyIds == false)
20  {
21  count = int.MinValue;
22  }
23  }

Member Function Documentation

◆ GetId()

int BGC.Utility.IdManager.GetId ( )
inline

Get an unused id

Returns

Definition at line 37 of file IdManager.cs.

Referenced by BGC.Utility.StaticIdManager.GetId().

38  {
39  ++count;
40  return count;
41  }
Here is the caller graph for this function:

◆ Reset()

void BGC.Utility.IdManager.Reset ( )
inline

Reset starting id to 0

Definition at line 28 of file IdManager.cs.

Referenced by BGC.Utility.StaticIdManager.Reset().

29  {
30  count = -1;
31  }
Here is the caller graph for this function:

Field Documentation

◆ count

int BGC.Utility.IdManager.count = -1
private

Definition at line 5 of file IdManager.cs.


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