◆ MessageSource() [1/2]
ClientProtocol::MessageSource::MessageSource |
( |
User * |
Sourceuser = NULL | ) |
|
|
inline |
Constructor, sets the source to be the full host of a user or sets it to be nothing. The actual source string when serializing will be obtained from User::GetFullHost() if the user is non-NULL.
- Parameters
-
Sourceuser | User to set as source of the message. If NULL, the message won't have a source when serialized. Optional, defaults to NULL. |
◆ MessageSource() [2/2]
ClientProtocol::MessageSource::MessageSource |
( |
const std::string & |
Sourcestr, |
|
|
User * |
Sourceuser = NULL |
|
) |
| |
|
inline |
Constructor, sets the source to the supplied string and optionally sets the source user.
- Parameters
-
Sourcestr | String to use as message source for serialization purposes. Must remain valid as long as this object is alive. |
Sourceuser | User to set as source. Optional, defaults to NULL. It will not be used for serialization but if provided it may be used internally, for example to create message tags. Useful when the source string is synthesized but it is still related to a User. |
◆ GetSource()
const std::string* ClientProtocol::MessageSource::GetSource |
( |
| ) |
const |
|
inline |
Get the source of this message as a string.
- Returns
- Pointer to the message source string or NULL if there is no source.
◆ GetSourceUser()
User* ClientProtocol::MessageSource::GetSourceUser |
( |
| ) |
const |
|
inline |
Get the source User. This shouldn't be used for serialization, use GetSource() for that.
- Returns
- User pointer if the message has a source user, NULL otherwise.
◆ SetSource() [1/2]
void ClientProtocol::MessageSource::SetSource |
( |
const MessageSource & |
other | ) |
|
|
inline |
◆ SetSource() [2/2]
void ClientProtocol::MessageSource::SetSource |
( |
const std::string & |
Sourcestr, |
|
|
User * |
Sourceuser = NULL |
|
) |
| |
|
inline |
Set the source string and optionally source user. See the two parameter constructor for a more detailed description.
- Parameters
-
Sourcestr | String source, to be used for serialization purposes. Must remain valid as long as this object is alive. |
Sourceuser | Source user to set, optional. |
◆ SetSourceUser()
void ClientProtocol::MessageSource::SetSourceUser |
( |
User * |
Sourceuser | ) |
|
|
inline |
Set the source of this message to a User. See the one parameter constructor for a more detailed description.
- Parameters
-
Sourceuser | User to set as source. |
The documentation for this class was generated from the following file: