Safir SDK Core
Loading...
Searching...
No Matches
Safir::Dob::Typesystem::ChannelId Class Reference

Class containing the identity of a channel. More...

#include <Safir/Dob/Typesystem/ChannelId.h>

Collaboration diagram for Safir::Dob::Typesystem::ChannelId:
[legend]

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.
 

Detailed Description

Class containing the identity of a channel.

Member Typedef Documentation

◆ UnderlyingType

Constructor & Destructor Documentation

◆ ChannelId() [1/4]

Safir::Dob::Typesystem::ChannelId::ChannelId ( )

Default constructor.

Creates a default channel id.

◆ ChannelId() [2/4]

Safir::Dob::Typesystem::ChannelId::ChannelId ( const std::wstring & id)

Constructor.

Creates a channel id from the given string.

Parameters
id[in] - String identifying the channel.

◆ ChannelId() [3/4]

Safir::Dob::Typesystem::ChannelId::ChannelId ( const Int64 id)
explicit

Constructor.

Creates a channel id from the given id.

Parameters
id[in] - Identifier identifying the channel.

◆ ChannelId() [4/4]

Safir::Dob::Typesystem::ChannelId::ChannelId ( const Int64 id,
const std::wstring & idStr )

Constructor.

Creates a channel id from the given data.

Parameters
id[in] - Identifier identifying the channel.
idStr[in] - String identifying the channel.

References __WFILE__.

Member Function Documentation

◆ GetRawString()

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.

Returns
The string (if any) that was used to create this id.

◆ GetRawValue()

UnderlyingType Safir::Dob::Typesystem::ChannelId::GetRawValue ( ) const

Get the raw 64 bit integer identifier.

Returns
The raw 64 bit identifier.

Referenced by Safir::Dob::Typesystem::hash_value().

Here is the caller graph for this function:

◆ operator!=()

bool Safir::Dob::Typesystem::ChannelId::operator!= ( const ChannelId & other) const

Inequality operator.

Parameters
other[in] - The ChannelId to compare with.

◆ operator<()

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.

Parameters
other[in] - The ChannelId to compare with.

◆ operator==()

bool Safir::Dob::Typesystem::ChannelId::operator== ( const ChannelId & other) const

Equality operator.

Parameters
other[in] - The ChannelId to compare with.

◆ RemoveString()

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.

◆ ToString()

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<<().

Here is the caller graph for this function:

◆ Utf8String()

const std::string & Safir::Dob::Typesystem::ChannelId::Utf8String ( ) const

Convert the string to UTF-8.

Returns an empty string if there is no string.

Returns
UTF-8 representation of the string.

References Safir::Dob::Typesystem::Utilities::ToUtf8().

Here is the call graph for this function:

◆ Utf8StringLength()

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.

Returns
The length of the string of the id when converted to UTF-8

References Safir::Dob::Typesystem::Utilities::ToUtf8().

Here is the call graph for this function:

Member Data Documentation

◆ ALL_CHANNELS

DOTS_CPP_API const ChannelId Safir::Dob::Typesystem::ChannelId::ALL_CHANNELS
static

Constant representing all channels.