MOOS 0.2375
Public Member Functions | Static Public Member Functions | Protected Member Functions
CMOOSDB Class Reference

#include <MOOSDB.h>

Collaboration diagram for CMOOSDB:
Collaboration graph
[legend]

List of all members.

Public Member Functions

bool OnDisconnect (string &sClient)
bool OnRxPkt (const std::string &sClient, MOOSMSG_LIST &MsgLstRx, MOOSMSG_LIST &MsgLstTx)
bool Run (const std::string &sMissionFile="")
long GetDBPort ()
 CMOOSDB ()
virtual ~CMOOSDB ()

Static Public Member Functions

static bool OnRxPktCallBack (const std::string &sClient, MOOSMSG_LIST &MsgLstRx, MOOSMSG_LIST &MsgLstTx, void *pParam)
static bool OnDisconnectCallBack (string &sClient, void *pParam)

Protected Member Functions

bool OnClearRequested (CMOOSMsg &Msg, MOOSMSG_LIST &MsgTxList)
void Var2Msg (CMOOSDBVar &Var, CMOOSMsg &Msg)
bool AddMessageToClientBox (const string &sClient, CMOOSMsg &Msg)
bool VariableExists (const string &sVar)
bool DoVarLookup (CMOOSMsg &Msg, MOOSMSG_LIST &MsgTxList)
bool OnServerAllRequested (CMOOSMsg &Msg, MOOSMSG_LIST &MsgTxList)
bool OnProcessSummaryRequested (CMOOSMsg &Msg, MOOSMSG_LIST &MsgTxList)
bool OnVarSummaryRequested (CMOOSMsg &Msg, MOOSMSG_LIST &MsgTxList)
void UpdateDBTimeVars ()
void UpdateDBClientsVar ()
bool DoServerRequest (CMOOSMsg &Msg, MOOSMSG_LIST &MsgTxList)
CMOOSDBVarGetOrMakeVar (CMOOSMsg &Msg)
bool OnRegister (CMOOSMsg &Msg)
bool OnUnRegister (CMOOSMsg &Msg)
bool OnNotify (CMOOSMsg &Msg)
bool ProcessMsg (CMOOSMsg &MsgRx, MOOSMSG_LIST &MsgLstTx)
double GetStartTime ()

Detailed Description

The CMOOSDB class is the core of the MOOS comms protocol. It is only of interest to the developer modifying the MOOSDB application server

Definition at line 51 of file MOOSDB.h.


Constructor & Destructor Documentation

CMOOSDB::CMOOSDB ( )

Definition at line 69 of file MOOSDB.cpp.

CMOOSDB::~CMOOSDB ( ) [virtual]

Definition at line 120 of file MOOSDB.cpp.


Member Function Documentation

bool CMOOSDB::AddMessageToClientBox ( const string &  sClient,
CMOOSMsg Msg 
) [protected]

we now want to store some message in anoth cleints message box, when they next call in they shall be informed of the change by stuffing this msg into a return packet

Definition at line 432 of file MOOSDB.cpp.

bool CMOOSDB::DoServerRequest ( CMOOSMsg Msg,
MOOSMSG_LIST MsgTxList 
) [protected]

Definition at line 585 of file MOOSDB.cpp.

bool CMOOSDB::DoVarLookup ( CMOOSMsg Msg,
MOOSMSG_LIST MsgTxList 
) [protected]
long CMOOSDB::GetDBPort ( ) [inline]

returns the port on which this DB is listening

Definition at line 72 of file MOOSDB.h.

CMOOSDBVar & CMOOSDB::GetOrMakeVar ( CMOOSMsg Msg) [protected]

return a reference to a DB variable is it already exists and if not make one and then return a reference to it.

Parameters:
MsgMsg.m_sKey contains name of variable

Definition at line 515 of file MOOSDB.cpp.

double CMOOSDB::GetStartTime ( ) [inline, protected]

Definition at line 101 of file MOOSDB.h.

bool CMOOSDB::OnClearRequested ( CMOOSMsg Msg,
MOOSMSG_LIST MsgTxList 
) [protected]

Definition at line 747 of file MOOSDB.cpp.

bool CMOOSDB::OnDisconnect ( string &  sClient)

Definition at line 565 of file MOOSDB.cpp.

bool CMOOSDB::OnDisconnectCallBack ( string &  sClient,
void *  pParam 
) [static]

called internally when a client disconnects

Definition at line 62 of file MOOSDB.cpp.

bool CMOOSDB::OnNotify ( CMOOSMsg Msg) [protected]

called when the in focus client is telling us something has changed. Ie this is a notify packet

Definition at line 305 of file MOOSDB.cpp.

bool CMOOSDB::OnProcessSummaryRequested ( CMOOSMsg Msg,
MOOSMSG_LIST MsgTxList 
) [protected]

Definition at line 611 of file MOOSDB.cpp.

bool CMOOSDB::OnRegister ( CMOOSMsg Msg) [protected]

Called when a msg containing a registration (subscription) request is received

Definition at line 478 of file MOOSDB.cpp.

bool CMOOSDB::OnRxPkt ( const std::string &  sClient,
MOOSMSG_LIST MsgListRx,
MOOSMSG_LIST MsgListTx 
)

called internally when a MOOSPkt (a collection of MOOSMsg's ) is received by the server

this will be called each time a new packet is recieved

Definition at line 218 of file MOOSDB.cpp.

bool CMOOSDB::OnRxPktCallBack ( const std::string &  sClient,
MOOSMSG_LIST MsgLstRx,
MOOSMSG_LIST MsgLstTx,
void *  pParam 
) [static]

callback function passed to CMOOSCommServer member object. This STATIC function allows entry back into this object by invoking OnRxPkt()

Definition at line 55 of file MOOSDB.cpp.

bool CMOOSDB::OnServerAllRequested ( CMOOSMsg Msg,
MOOSMSG_LIST MsgTxList 
) [protected]

Next three functions are unusual and their genus should not proliferate. Very occasionally a client with a singularly unusual role may want to ask questions directly to the DB. The paired function is in MOOCCommClient::ServerRequest which unusually, is blocking (with timeout) - hence my edgey feel about these utilities

Definition at line 673 of file MOOSDB.cpp.

bool CMOOSDB::OnUnRegister ( CMOOSMsg Msg) [protected]

Called when a msg containing a unregistration (desubscribe) request is received

Definition at line 459 of file MOOSDB.cpp.

bool CMOOSDB::OnVarSummaryRequested ( CMOOSMsg Msg,
MOOSMSG_LIST MsgTxList 
) [protected]

Definition at line 713 of file MOOSDB.cpp.

bool CMOOSDB::ProcessMsg ( CMOOSMsg MsgRx,
MOOSMSG_LIST MsgListTx 
) [protected]

This functions decides what needs to be done on a message by message basis

Definition at line 275 of file MOOSDB.cpp.

bool CMOOSDB::Run ( const std::string &  sMissionFile = "")

called by the owning application to start the DB running. It launches threads and returns

Definition at line 125 of file MOOSDB.cpp.

void CMOOSDB::UpdateDBClientsVar ( ) [protected]

Definition at line 173 of file MOOSDB.cpp.

void CMOOSDB::UpdateDBTimeVars ( ) [protected]

Definition at line 198 of file MOOSDB.cpp.

void CMOOSDB::Var2Msg ( CMOOSDBVar Var,
CMOOSMsg Msg 
) [protected]

Definition at line 824 of file MOOSDB.cpp.

bool CMOOSDB::VariableExists ( const string &  sVar) [protected]

Definition at line 817 of file MOOSDB.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines