Expanded doc comments.

- Added doc comments to the DataManager class.
 - Added description of LOG_VERBOSITY levels and reset the value.
 - Added doc comment to DataMap.
 - Added doc comments to MessageHandlers class.
This commit is contained in:
Jason Watkins
2015-04-14 12:59:20 -07:00
parent 96d1d68123
commit 5944fb5818
4 changed files with 279 additions and 14 deletions

View File

@@ -10,13 +10,31 @@
namespace XPC
{
/// A function that handles a message.
typedef void(*MessageHandler)(Message&);
/// Handles incommming messages and manages connections.
///
/// \author Jason Watkins
/// \version 1.0
/// \since 1.0
/// \date Intial Version: 2015-04-12
/// \date Last Updated: 2015-04-12
class MessageHandlers
{
public:
/// The first stop for all messages to the plugin after they are read from the
/// socket.
///
/// \details After a message is read, HandleMessage analyzes the sender's network address
/// to determine whether the sender is a new client. It then either loads
/// connection details for an existing client, or creates a new connection record
/// for new clients. Finally, the message handler checks the message type and
/// dispatches the message to the appropriate handler.
/// \param msg The message to be processed.
static void HandleMessage(Message& msg);
/// Sets the socke that message handlers use to send responses.
static void SetSocket(UDPSocket* socket);
private:
@@ -44,9 +62,9 @@ namespace XPC
static std::unordered_map<std::string, ConnectionInfo> connections;
static std::unordered_map<std::string, MessageHandler> handlers;
static std::string connectionKey;
static ConnectionInfo connection;
static UDPSocket* sock;
static std::string connectionKey; // The current connection ip:port string
static ConnectionInfo connection; // The current connection record
static UDPSocket* sock; // Outgoing network socket
};
}