#include <link.h>
Public Methods | |
TObjectID () | |
TObjectID (const TObjectID &Object) | |
TObjectID (const byte *ByteArray, bool bTemp=false) | |
TObjectID (const int *IntArray, bool bTemp=false) | |
bool | isNull () const |
bool | isTemp () const |
bool | load (TDataPackageList *in, const string &sIdentifier, bool bUnique=true) |
TObjectID & | operator= (const TObjectID &Object) |
TObjectID | operator++ () |
TObjectID | operator++ (int) |
bool | operator== (const TObjectID &Object) const |
bool | operator!= (const TObjectID &Object) const |
bool | operator< (const TObjectID &Object) const |
bool | save (TDataPackageList *out, const string &sIdentifier, bool bUnique=true, bool bAutoDelete=false) const |
void | setID (const byte *ByteArray, bool bTemp=false) |
void | setID (const int *IntArray, bool bTemp=false) |
void | setNull () |
void | setTemp (bool bTemp) |
void | write (ostream &out) const |
Static Public Methods | |
int | getIDSize () |
Static Public Attributes | |
const int | ID_SIZE = 6 |
Private Attributes | |
byte | ObjectID [ID_SIZE] |
bool | bTemp |
Friends | |
class | TLinkUpdate |
In addition to the 6 byte array TObjectID stores a flag which shows if the ID is a real one or just temp. (temp in the sense that this ID is at once transformed to a real ID on the server side. Therefore temp IDs exist on the client-side only) This is useful on the client side, since the objects generated there (e.g. split fleet) need new ID numbers which are not unique. Note: temp IDs do only exist on the client side, never on the server side. The necessary transformation of the IDs is part of TLinkUpdate.
TObjectID is mainly used in TLinkable to give all linkable objects their own and unique ID.
|
The constructor sets bTemp = |
|
Copy constructor to allow calls like: TObjectID One = Two;
|
|
Initialization of the object ID with a byte array. bTemp is set to
|
|
Constructor for initializing the object with an integer array. It is assumed that the integers are between 0 and 255 otherwise the method sends a warning message to the log file.
|
|
|
|
|
|
|
|
Loads a TObjectID object from a list of data packages. Note that a successful load will delete the datapackage from the data package list as well as the datapackage itself.
|
|
Compares two IDs to find out if they are different.
|
|
The (postfix) incrementation operator increases the ID by 1.
|
|
The (prefix) incrementation operator increases the ID by 1.
|
|
Compares two IDs to find out which of them is smaller. Note: a temp ID is always smaller than a real ID.
|
|
The standard equal operator simply copies the byte array and the bTemp flag.
|
|
Compares two IDs to find out if they are equal. Note that two IDs are never identical if their temp flag differs.
|
|
Creates the data package for a TObjectID object and adds it to the data package list. Note: Do not modify the auto delete setting of the data package!
|
|
Reads an array of integers to initalize the object. Since integers have a different range, values >255 are treated as 255, values <0 are treated as 0.
|
|
Reads an array of bytes to initalize the object.
|
|
Sets the ID to { 0, 0, ..., 0 }. The temp flag bTemp is not changed.
|
|
Sets the bTemp flag. Note: the ID is not changed.
|
|
Writes the ID to a stream. The result looks like: "[0f,00,00,00,00,00]" or if it is a temp object "temp[01,04,00,00,00,00]".
|
|
Describes if the ID is a temp or a real one |
|
The number of bytes used for one ID |
|
The ID is an array of a fixed number of bytes |