In file NsgCmdInterpreter.hxx:

class NsgCmdInterpreter : public CAVERNdb_sharedState_c

Observes a CAVERNdb_client and is triggered by received network packets

Inheritance:


Public Methods

NsgCmdInterpreter ( CAVERNdb_client_c* dbc, char* path, char* key)
Class constructor
virtual ~NsgCmdInterpreter ()
Class Destructor
virtual void update ( CAVERNmisc_subject_c *subj )
Called when the db client calls its notify method ie when a new network command arrives
virtual int publishCmd ( NsgCmd* cmd )
Trasmits the command and data in the given NsgCmd to the server

Protected Methods

virtual int unpackState ( char *data )
Called by update function
virtual int packAndSendState ()
puts the data to the server

Documentation

Observes a CAVERNdb_client and is triggered by received network packets. It used the first word of the received character string to look up the command in the registry, and it then makes the command execute. It should also place specified commands onto the network.
NsgCmdInterpreter( CAVERNdb_client_c* dbc, char* path, char* key)
Class constructor. Creating an instance of a NsgCmdInterpreter requires a reference to a database client which already exists. The NsgCmdInterpreter will be registered with the client as an observer. Additionally, path and key names are stored within the state for tranmitting and receiving state updates. Sharing is enabled.
Parameters:
dbclient - pointer to an instantiated database client
path - path string to associate with this state
key - key string to associate with this state

virtual void update( CAVERNmisc_subject_c *subj )
Called when the db client calls its notify method ie when a new network command arrives
Parameters:
subj - pointer to the dbclient that reflects commands

virtual int publishCmd( NsgCmd* cmd )
Trasmits the command and data in the given NsgCmd to the server. Calls the toStream method of NsgCmd to serialize the command.
Parameters:
cmd - the command that needs to be sent across

virtual int unpackState( char *data )
Called by update function. Checks the first token in the given string for the command name and calls the respective NsgCmd's execute with the additional data
Parameters:
data - character data buffer received from the server


This class has no child classes.
Author:
Chris Scharver, Shalini Venkataraman

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de