![]() |
Safir SDK Core
|
Class containing the identity of a channel. More...
#include <Safir/Dob/Typesystem/ChannelId.h>
Public Member Functions | |
ChannelId () | |
Default constructor. | |
ChannelId (const std::wstring &id) | |
Constructor. | |
ChannelId (const Int64 id) | |
Constructor. | |
ChannelId (const Int64 id, const std::wstring &idStr) | |
Constructor. | |
void | RemoveString () |
Remove the included string from the channel id. | |
bool | operator== (const ChannelId &other) const |
Equality operator. | |
bool | operator!= (const ChannelId &other) const |
Inequality operator. | |
bool | operator< (const ChannelId &other) const |
Less-than operator. | |
DOTS_CPP_API const std::wstring | ToString () const |
Return a string representation of the channel id. | |
Static Public Attributes | |
static DOTS_CPP_API const ChannelId | ALL_CHANNELS |
Constant representing all channels. | |
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 channel.
Safir::Dob::Typesystem::ChannelId::ChannelId | ( | ) |
Default constructor.
Creates a default channel id.
Safir::Dob::Typesystem::ChannelId::ChannelId | ( | const std::wstring & | id | ) |
Constructor.
Creates a channel id from the given string.
id | [in] - String identifying the channel. |
|
explicit |
Constructor.
Creates a channel id from the given id.
id | [in] - Identifier identifying the channel. |
Safir::Dob::Typesystem::ChannelId::ChannelId | ( | const Int64 | id, |
const std::wstring & | idStr ) |
Constructor.
Creates a channel id from the given data.
id | [in] - Identifier identifying the channel. |
idStr | [in] - String identifying the channel. |
References __WFILE__.
const std::wstring & Safir::Dob::Typesystem::ChannelId::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::ChannelId::GetRawValue | ( | ) | const |
Get the raw 64 bit integer identifier.
Referenced by Safir::Dob::Typesystem::hash_value().
bool Safir::Dob::Typesystem::ChannelId::operator!= | ( | const ChannelId & | other | ) | const |
Inequality operator.
other | [in] - The ChannelId to compare with. |
bool Safir::Dob::Typesystem::ChannelId::operator< | ( | const ChannelId & | other | ) | const |
Less-than operator.
This is provided to allow ChannelIds to be stored in STL containers that need strict weak ordering.
other | [in] - The ChannelId to compare with. |
bool Safir::Dob::Typesystem::ChannelId::operator== | ( | const ChannelId & | other | ) | const |
Equality operator.
other | [in] - The ChannelId to compare with. |
void Safir::Dob::Typesystem::ChannelId::RemoveString | ( | ) |
Remove the included string from the channel 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::ChannelId::ToString | ( | ) | const |
Return a string representation of the channel id.
Referenced by Safir::Dob::Typesystem::operator<<().
const std::string & Safir::Dob::Typesystem::ChannelId::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::ChannelId::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 channels.