Main Page | Modules | Class Hierarchy | Data Structures | File List | Data Fields | Globals | Related Pages

omTCPParser Class Reference
[GENERIC LIBRARY classes]

#include <omTCPParser.h>

Inheritance diagram for omTCPParser:

omObject

Public Member Functions

 omTCPParser ()
int AnalizeChar (char)
bool GetRegisterMessage (wxString *, wxString *)
bool GetGenericMessage (omTCPMessage *)

Private Member Functions

bool GetParameterValue (wxString, wxString *)
int GetDecodedParameters (wxString, wxArrayString *)
void ResetInitialStatus ()

Private Attributes

bool messageReceived
 True if message is received.

bool receivingMessage
 True if in receiving message status.

bool registerMessage
 True if register meessage type.

bool genericMessage
 True if generic message type.

omTCPMessage genericMessageData
 Received message buffer.

wxString agentName
 Registered message agent name.

wxString serviceName
 Registered message service name.

bool receivingEscape
 True if receiving an escape sequence.

bool receivingRegister
 flag

bool receivingGeneric
 flag

bool messageStarting
 flag

bool messageEnding
 flag

bool messageStarted
 flag

bool messageEnded
 flag

int charCounter
 generic character counterz

wxString partialMessage
 Partial message buffer.


Detailed Description

TCP Message Parser.

This class is used to parse TCP messages used by the agents.
Every character received from a TCP socket is analized by AnalizeChar() method of this class. This method compose and analize the message. The method return a code corresponing to the type of the message analized.

If OM_REGISTER_MESSAGE is received method GetRegisterMessage() return message data.
If OM_GENERIC_MESSAGE is received method GetGenericMessage() return message data.


Constructor & Destructor Documentation

omTCPParser::omTCPParser  ) 
 

Build omTCPParser object initializing variables


Member Function Documentation

int omTCPParser::AnalizeChar char  c  ) 
 

Analize a character coming from TCP/IP connection. This method compose a message and parses it.

Parameters:
c character to analiza
Returns:
OM_NO_MESSAGE if message is not completed, OM_REGISTER_MESSAGE if register message is completed, OM_GENERIC_MESSAGE if generic message is compleded.
See also:
class documentation.

int omTCPParser::GetDecodedParameters wxString  line,
wxArrayString *  parsValue
[private]
 

Find a list of parameters in a line of the TCP message, decode them and fill a wxArrayString strcuture.

Parameters:
line line of the message
parsValue array buffer in wich insert parameters
Returns:
number of inserted parameters

bool omTCPParser::GetGenericMessage omTCPMessage message  ) 
 

Get generic message data.

Parameters:
message pointer to message buffer
Returns:
true if have generic message information, false if not

bool omTCPParser::GetParameterValue wxString  line,
wxString *  parValue
[private]
 

Find a parameter in a line of the TCP message

Parameters:
line line of the message
parValue buffer to insert parameter value
Returns:
true if the line is correct, false if incorrect

bool omTCPParser::GetRegisterMessage wxString *  agent,
wxString *  service
 

Get register message data.

Parameters:
agent pointer to an agent name buffer.
service pointer to a service name buffer.
Returns:
true if have register message information, false if not.

void omTCPParser::ResetInitialStatus  )  [private]
 


Field Documentation

wxString omTCPParser::agentName [private]
 

Registered message agent name.

int omTCPParser::charCounter [private]
 

generic character counterz

bool omTCPParser::genericMessage [private]
 

True if generic message type.

omTCPMessage omTCPParser::genericMessageData [private]
 

Received message buffer.

bool omTCPParser::messageEnded [private]
 

flag

bool omTCPParser::messageEnding [private]
 

flag

bool omTCPParser::messageReceived [private]
 

True if message is received.

bool omTCPParser::messageStarted [private]
 

flag

bool omTCPParser::messageStarting [private]
 

flag

wxString omTCPParser::partialMessage [private]
 

Partial message buffer.

bool omTCPParser::receivingEscape [private]
 

True if receiving an escape sequence.

bool omTCPParser::receivingGeneric [private]
 

flag

bool omTCPParser::receivingMessage [private]
 

True if in receiving message status.

bool omTCPParser::receivingRegister [private]
 

flag

bool omTCPParser::registerMessage [private]
 

True if register meessage type.

wxString omTCPParser::serviceName [private]
 

Registered message service name.


The documentation for this class was generated from the following files: