Registry to keep track of clients who want to receive data from the Message Server. Message Clients must register themselves to receive data from the Message Server. More...
#include <messageserver.h>
Public Member Functions | |
Registry () | |
Constructor. | |
~Registry () | |
Destructor. | |
int | OpenRegistry (const ID registryID) |
Open a view of the registry. Allows you to register/unregister and get a view of all registered client ID's. | |
int | OpenRegistry (const std::string ®istryID) |
Open a view of the registry. Allows you to register/unregister and get a view of all registered client ID's. | |
int | CreateRegistry (const ID registryID, const unsigned int maxClients=MaxClients) |
Creates a registry. This option is only available to MessageServer. | |
int | CreateRegistry (const std::string ®istryID, const unsigned int maxClients=MaxClients) |
Creates a registry. This option is only available to MessageServer. | |
int | CloseRegistry () |
Closes the view of the registry. | |
int | Register (const ID id) |
Adds the ID to the registry. | |
int | Unregister (const ID id) |
Removes the ID from the registry. | |
int | GetRegistry (List ®istry) |
Gets a copy of all the client ID's in the registry. | |
bool | IsRegistered (const ID id) const |
Checks to see if an ID is in the registry. | |
bool | IsOpen () const |
bool | IsActive (const unsigned int thresholdMs=500) const |
Check to see if a server is actively checking the server for clients. | |
Static Public Attributes | |
static const unsigned int | MaxClients = 25 |
Maximum number of clients (change if necessary). | |
static const unsigned int | HeaderSize = 20 |
Size of registry header. | |
Friends | |
class | MessageServer |
Registry to keep track of clients who want to receive data from the Message Server. Message Clients must register themselves to receive data from the Message Server.
Definition at line 76 of file messageserver.h.
MessageServer::Registry::Registry | ( | ) |
Constructor.
Definition at line 59 of file messageserver.cpp.
MessageServer::Registry::~Registry | ( | ) |
Destructor.
Definition at line 70 of file messageserver.cpp.
int MessageServer::Registry::CloseRegistry | ( | ) |
Closes the view of the registry.
Definition at line 138 of file messageserver.cpp.
int MessageServer::Registry::CreateRegistry | ( | const ID | registryID, |
const unsigned int | maxClients = MaxClients |
||
) |
Creates a registry. This option is only available to MessageServer.
[in] | registryID | The ID to use for the registry. In Windows this can be a string of any kind. This should also with Linux, but you will have more reliable results using a number. |
[in] | maxClients | Maximum number of clients. |
Definition at line 385 of file messageserver.cpp.
int MessageServer::Registry::CreateRegistry | ( | const std::string & | registryID, |
const unsigned int | maxClients = MaxClients |
||
) |
Creates a registry. This option is only available to MessageServer.
[in] | registryID | The ID to use for the registry. In Windows this can be a string of any kind. This should also with Linux, but you will have more reliable results using a number. |
[in] | maxClients | Maximum number of clients. |
Definition at line 406 of file messageserver.cpp.
int MessageServer::Registry::GetRegistry | ( | MessageServer::List & | registry ) |
Gets a copy of all the client ID's in the registry.
[in] | registry | List of all items in the Registry. |
Definition at line 272 of file messageserver.cpp.
bool MessageServer::Registry::IsActive | ( | const unsigned int | thresholdMs = 500 ) |
const |
Check to see if a server is actively checking the server for clients.
[in] | thresholdMs | How long of a threshold to determine if a server is actively checking the registry. For example, if this value is 500, then the method will return false if no server has checked the registry in more than 500 ms. |
Definition at line 348 of file messageserver.cpp.
bool CxUtils::MessageServer::Registry::IsOpen | ( | ) | const [inline] |
Definition at line 95 of file messageserver.h.
bool MessageServer::Registry::IsRegistered | ( | const ID | id ) | const |
Checks to see if an ID is in the registry.
[in] | id | The client ID to check for. |
Definition at line 308 of file messageserver.cpp.
int MessageServer::Registry::OpenRegistry | ( | const std::string & | registryID ) |
Open a view of the registry. Allows you to register/unregister and get a view of all registered client ID's.
[in] | registryID | The ID to use for the registry. In Windows this can be a string of any kind. This should also with Linux, but you will have more reliable results using a number. |
Definition at line 108 of file messageserver.cpp.
int MessageServer::Registry::OpenRegistry | ( | const ID | registryID ) |
Open a view of the registry. Allows you to register/unregister and get a view of all registered client ID's.
[in] | registryID | The ID to use for the registry. In Windows this can be a string of any kind. This should also with Linux, but you will have more reliable results using a number. |
Definition at line 88 of file messageserver.cpp.
int MessageServer::Registry::Register | ( | const ID | id ) |
Adds the ID to the registry.
[in] | id | The client ID to register. |
Definition at line 179 of file messageserver.cpp.
int MessageServer::Registry::Unregister | ( | const ID | id ) |
Removes the ID from the registry.
[in] | id | The client ID to unregister. |
Definition at line 227 of file messageserver.cpp.
friend class MessageServer [friend] |
Definition at line 79 of file messageserver.h.
const unsigned int CxUtils::MessageServer::Registry::HeaderSize = 20 [static] |
Size of registry header.
Definition at line 81 of file messageserver.h.
const unsigned int CxUtils::MessageServer::Registry::MaxClients = 25 [static] |
Maximum number of clients (change if necessary).
Definition at line 80 of file messageserver.h.