![]() |
Safir SDK Core
|
Class containing the identity of a handler. More...
#include <Safir/Dob/Typesystem/HandlerId.h>
Public Member Functions | |
HandlerId () | |
Default constructor. | |
HandlerId (const std::wstring &id) | |
Constructor. | |
HandlerId (const Int64 id) | |
Constructor. | |
HandlerId (const Int64 id, const std::wstring &idStr) | |
Constructor. | |
void | RemoveString () |
Remove the included string from the handler id. | |
bool | operator== (const HandlerId &other) const |
Equality operator. | |
bool | operator!= (const HandlerId &other) const |
Inequality operator. | |
bool | operator< (const HandlerId &other) const |
Less-than operator. | |
DOTS_CPP_API const std::wstring | ToString () const |
Return a string representation of the handler id. | |
Static Public Attributes | |
static DOTS_CPP_API const HandlerId | ALL_HANDLERS |
Constant representing all handlers. | |
Internal functions. | |
typedef Int64 | UnderlyingType |
UnderlyingType | GetRawValue () const |
Get the raw 64 bit integer identifier. | |
const std::wstring & | GetRawString () const |
Get the string that was used to create this id. | |
Int32 | Utf8StringLength () const |
Get the length of the string when converted to UTF-8 encoding. | |
const std::string & | Utf8String () const |
Convert the string to UTF-8. | |
Class containing the identity of a handler.
Safir::Dob::Typesystem::HandlerId::HandlerId | ( | ) |
Default constructor.
Creates a default handler id.
Safir::Dob::Typesystem::HandlerId::HandlerId | ( | const std::wstring & | id | ) |
Constructor.
Creates a handler id from the given string.
id | [in] - String identifying the handler. |
|
explicit |
Constructor.
Creates a handler id from the given id.
id | [in] - Identifier identifying the handler. |
Safir::Dob::Typesystem::HandlerId::HandlerId | ( | const Int64 | id, |
const std::wstring & | idStr ) |
Constructor.
Creates a handler id from the given data.
id | [in] - Identifier identifying the handler. |
idStr | [in] - String identifying the handler. |
References __WFILE__.
const std::wstring & Safir::Dob::Typesystem::HandlerId::GetRawString | ( | ) | const |
Get the string that was used to create this id.
If no string was used this method returns an empty string.
UnderlyingType Safir::Dob::Typesystem::HandlerId::GetRawValue | ( | ) | const |
Get the raw 64 bit integer identifier.
Referenced by Safir::Dob::Typesystem::hash_value().
bool Safir::Dob::Typesystem::HandlerId::operator!= | ( | const HandlerId & | other | ) | const |
Inequality operator.
other | [in] - The HandlerId to compare with. |
bool Safir::Dob::Typesystem::HandlerId::operator< | ( | const HandlerId & | other | ) | const |
Less-than operator.
This is provided to allow HandlerIds to be stored in STL containers that need strict weak ordering.
other | [in] - The HandlerId to compare with. |
bool Safir::Dob::Typesystem::HandlerId::operator== | ( | const HandlerId & | other | ) | const |
Equality operator.
other | [in] - The HandlerId to compare with. |
void Safir::Dob::Typesystem::HandlerId::RemoveString | ( | ) |
Remove the included string from the handler id.
This is meant to be used when this type is used as a member of a Dob object. Using this call before the object gets serialized to binary or xml (i.e. also before sending it anywhere) means that the string will not be included when the object is sent.
DOTS_CPP_API const std::wstring Safir::Dob::Typesystem::HandlerId::ToString | ( | ) | const |
Return a string representation of the handler id.
Referenced by Safir::Dob::Typesystem::operator<<().
const std::string & Safir::Dob::Typesystem::HandlerId::Utf8String | ( | ) | const |
Convert the string to UTF-8.
Returns an empty string if there is no string.
References Safir::Dob::Typesystem::Utilities::ToUtf8().
Int32 Safir::Dob::Typesystem::HandlerId::Utf8StringLength | ( | ) | const |
Get the length of the string when converted to UTF-8 encoding.
Includes one byte for a null termination.
References Safir::Dob::Typesystem::Utilities::ToUtf8().
|
static |
Constant representing all handlers.