Space Engineers
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | List of all members
VRage.Utils.MyStringId Struct Reference

Generates unique IDs for strings. When used as key for hash tables (Dictionary or HashSet) always pass in MyStringId.Comparer, otherwise lookups will allocate memory! Never serialize to network or disk! More...

Classes

class  IdComparerType
 

Public Member Functions

override string ToString ()
 
override int GetHashCode ()
 
override bool Equals (object obj)
 
bool Equals (MyStringId id)
 

Static Public Member Functions

static bool operator== (MyStringId lhs, MyStringId rhs)
 
static bool operator!= (MyStringId lhs, MyStringId rhs)
 
static operator int (MyStringId id)
 
static MyStringId ()
 
static MyStringId GetOrCompute (string str)
 
static MyStringId Get (string str)
 
static bool TryGet (string str, out MyStringId id)
 
static MyStringId TryGet (string str)
 
static bool IsKnown (MyStringId id)
 

Static Public Attributes

static readonly MyStringId NullOrEmpty
 
static readonly IdComparerType Comparer = new IdComparerType()
 

Properties

int Id [get]
 
string String [get]
 

Detailed Description

Generates unique IDs for strings. When used as key for hash tables (Dictionary or HashSet) always pass in MyStringId.Comparer, otherwise lookups will allocate memory! Never serialize to network or disk!

IDs are created sequentially as they get requested so two IDs might be different between sessions or clients and server. You can safely use ToString() as it will not allocate.

Definition at line 17 of file MyStringId.cs.

Constructor & Destructor Documentation

static VRage.Utils.MyStringId.MyStringId ( )
inlinestatic

Definition at line 96 of file MyStringId.cs.

Member Function Documentation

override bool VRage.Utils.MyStringId.Equals ( object  obj)
inline

Definition at line 55 of file MyStringId.cs.

bool VRage.Utils.MyStringId.Equals ( MyStringId  id)
inline

Definition at line 60 of file MyStringId.cs.

static MyStringId VRage.Utils.MyStringId.Get ( string  str)
inlinestatic

Definition at line 128 of file MyStringId.cs.

override int VRage.Utils.MyStringId.GetHashCode ( )
inline

Definition at line 50 of file MyStringId.cs.

static MyStringId VRage.Utils.MyStringId.GetOrCompute ( string  str)
inlinestatic

Definition at line 107 of file MyStringId.cs.

static bool VRage.Utils.MyStringId.IsKnown ( MyStringId  id)
inlinestatic

Definition at line 154 of file MyStringId.cs.

static VRage.Utils.MyStringId.operator int ( MyStringId  id)
inlineexplicitstatic

Definition at line 68 of file MyStringId.cs.

static bool VRage.Utils.MyStringId.operator!= ( MyStringId  lhs,
MyStringId  rhs 
)
inlinestatic

Definition at line 66 of file MyStringId.cs.

static bool VRage.Utils.MyStringId.operator== ( MyStringId  lhs,
MyStringId  rhs 
)
inlinestatic

Definition at line 65 of file MyStringId.cs.

override string VRage.Utils.MyStringId.ToString ( )
inline

Definition at line 45 of file MyStringId.cs.

static bool VRage.Utils.MyStringId.TryGet ( string  str,
out MyStringId  id 
)
inlinestatic

Definition at line 136 of file MyStringId.cs.

static MyStringId VRage.Utils.MyStringId.TryGet ( string  str)
inlinestatic

Definition at line 144 of file MyStringId.cs.

Member Data Documentation

readonly IdComparerType VRage.Utils.MyStringId.Comparer = new IdComparerType()
static

Definition at line 89 of file MyStringId.cs.

readonly MyStringId VRage.Utils.MyStringId.NullOrEmpty
static

Definition at line 19 of file MyStringId.cs.

Property Documentation

int VRage.Utils.MyStringId.Id
get

Definition at line 30 of file MyStringId.cs.

string VRage.Utils.MyStringId.String
get

Definition at line 35 of file MyStringId.cs.


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