Thread portable class


Gate portable class


Timer class


Pool class


Terimber 2.0


About C++


Downloads Products & Services Support Clients Open Source About



Home / Open source / Terimber 2.0

terimber_aiomsg Class Reference

#include <aiomsgfactory.h>

Inheritance diagram for terimber_aiomsg:

terimber_log_helper terimber_log aiomsg

List of all members.

Public Member Functions

virtual ~terimber_aiomsg ()
 destructor
virtual bool init (const char *info, const char *ini_key)=0
 initial functions to activate and deactivate message transport
virtual bool init (const void *buffer, size_t len)=0
 initial functions to activate and deactivate message transport
virtual bool uninit ()=0
 function uninitializes the message port
virtual bool start (msg_callback_notify *callback, size_t additional_thread_count)=0
 function that activates and deactivates callback port it make sense to specify additional_thread_count > 0 if the order incoming messages doesn't matter otherwise specify additional_thread_count = 0 and process incoming messages one by one in order as they arrived
virtual bool stop ()=0
 function stops message processing
virtual const char * get_port_error () const =0
 message port error function
virtual const guid_tget_port_address () const =0
 returns the port address - comes from init file
virtual msg_tconstruct (size_t size)=0
 internal allocate, reallocate, and free memory caller has to create ALL messages through construct function and call destroy function to free memory return pointer to the message object or null
virtual bool resize (msg_t *msg, size_t size)=0
 resizes the message the old memory will be preserved
virtual bool destroy (msg_t *msg)=0
 destroys message
virtual size_t get_size (const msg_t *msg) const =0
 messages content management functions
virtual bool write_buffer (msg_t *msg, size_t offset, const void *buf, size_t len)=0
 function returns true if offset + len <= message size (see resize function)
virtual const void * get_buffer (const msg_t *msg) const =0
 constant variant of previous function
virtual bool set_receiver (msg_t *msg, const guid_t &receiver)=0
 messages from/to settings
virtual bool get_sender (const msg_t *msg, guid_t &sender) const =0
 gets sender address
virtual bool send (bool copy, msg_t *msg, msg_t **reply)=0
 function send message and wait the reply for timeout milliseconds (garantee delivery) if function returns false the caller is still responsible for message destruction regardless the copy parameter value
virtual guid_t send_async (bool copy, msg_t *msg)=0
 function sends message asynchronically (guarantee delivery) and returns unique identificator (zero means error) which will be used as input parameter for asynchronous callback function if function returns zero the caller is still responsible for message destruction regardless the copy parameter value retun value, if non zero is unique identificator, which will be used for firing asynchronous reply, see above
virtual bool post (bool copy, msg_t *msg)=0
 function posts message and doesn't wait for a reply - this is a non-guarantee delivery if function returns false the caller is still responsible for message destruction regardless the copy parameter value
virtual bool add_connection (const char *xml_description)=0
 additional functionality to manage connections dynamically - xml string describes connection as xml node of follow XDTD extended DTD <!ENTITY % kind "(rpc | sock | p2p)"> <!ELEMENT connection EMPTY> <!ATTLIST connection address CTYPE vt_guid REQUIRED port CTYPE vt_ub2 IMPLIED network CDATA IMPLIED ping CTYPE vt_ub4 IMPLIED info CDATA IMPLIED security CTYPE vt_bool IMPLIED password CDATA IMPLIED > encpytion is reserved for production version
virtual bool add_listener (const char *xml_description)=0
 additional functionality to manage listeners dynamically - xml string describes connection as xml node of follow XDTD extended DTD <!ELEMENT listener (accept | reject)?> <!ELEMENT reject (peer)+> <!ELEMENT accept (peer)+> <!ELEMENT peer EMPTY> <!ATTLIST peer address CTYPE vt_guid REQUIRED security CTYPE vt_bool IMPLIED password CDATA IMPLIED > <!ATTLIST listener port CTYPE vt_ub2 IMPLIED network CDATA IMPLIED connections CTYPE vt_ub4 IMPLIED ping CTYPE vt_ub4 IMPLIED waste CTYPE vt_ub4 IMPLIED info CDATA IMPLIED security CTYPE vt_bool IMPLIED password CDATA IMPLIED >
virtual bool remove_connection (const guid_t &address)=0
 removes connection dynamically
virtual bool remove_listener (const char *type)=0
 removes listener dynamically
virtual void doxray ()=0
 do xray


Detailed Description

Definition at line 78 of file aiomsgfactory.h.


Constructor & Destructor Documentation

virtual terimber_aiomsg::~terimber_aiomsg (  )  [inline, virtual]

destructor

Definition at line 82 of file aiomsgfactory.h.


Member Function Documentation

virtual bool terimber_aiomsg::init ( const char *  info,
const char *  ini_key 
) [pure virtual]

initial functions to activate and deactivate message transport

Parameters:
info  a full path to the ini xml file with port initialization information
ini_key  crypto key for decription ini xml file - reserved for production version

Implemented in aiomsg.

virtual bool terimber_aiomsg::init ( const void *  buffer,
size_t  len 
) [pure virtual]

initial functions to activate and deactivate message transport

Parameters:
buffer  a pointer to xml memory
len  parameter is a length of xml in memory

Implemented in aiomsg.

virtual bool terimber_aiomsg::uninit (  )  [pure virtual]

function uninitializes the message port

Implemented in aiomsg.

virtual bool terimber_aiomsg::start ( msg_callback_notify callback,
size_t  additional_thread_count 
) [pure virtual]

function that activates and deactivates callback port it make sense to specify additional_thread_count > 0 if the order incoming messages doesn't matter otherwise specify additional_thread_count = 0 and process incoming messages one by one in order as they arrived

Parameters:
callback  pointer to the callback class instance
additional_thread_count  user defines how many threads can call incoming callback function at the same time

Implemented in aiomsg.

virtual bool terimber_aiomsg::stop (  )  [pure virtual]

function stops message processing

Implemented in aiomsg.

virtual const char* terimber_aiomsg::get_port_error (  )  const [pure virtual]

message port error function

Implemented in aiomsg.

virtual const guid_t& terimber_aiomsg::get_port_address (  )  const [pure virtual]

returns the port address - comes from init file

Implemented in aiomsg.

virtual msg_t* terimber_aiomsg::construct ( size_t  size  )  [pure virtual]

internal allocate, reallocate, and free memory caller has to create ALL messages through construct function and call destroy function to free memory return pointer to the message object or null

Parameters:
size  size of message in bytes

Implemented in aiomsg.

virtual bool terimber_aiomsg::resize ( msg_t msg,
size_t  size 
) [pure virtual]

resizes the message the old memory will be preserved

Parameters:
msg  pointer to the message to be resized
size  new size of message in bytes

Implemented in aiomsg.

virtual bool terimber_aiomsg::destroy ( msg_t msg  )  [pure virtual]

destroys message

Parameters:
msg  pointer to the message to be destroyed

Implemented in aiomsg.

virtual size_t terimber_aiomsg::get_size ( const msg_t msg  )  const [pure virtual]

messages content management functions

function returns the message size

Parameters:
msg  pointer to the message

Implemented in aiomsg.

virtual bool terimber_aiomsg::write_buffer ( msg_t msg,
size_t  offset,
const void *  buf,
size_t  len 
) [pure virtual]

function returns true if offset + len <= message size (see resize function)

Parameters:
msg  pointer to the message
offset  offset from the beginning of message body
buf  pointer to the buffer
len  length of writing buffer

Implemented in aiomsg.

virtual const void* terimber_aiomsg::get_buffer ( const msg_t msg  )  const [pure virtual]

constant variant of previous function

Parameters:
msg  pointer to the constant message

Implemented in aiomsg.

virtual bool terimber_aiomsg::set_receiver ( msg_t msg,
const guid_t receiver 
) [pure virtual]

messages from/to settings

Parameters:
msg  pointer to the message
receiver  reference to receiver address

Implemented in aiomsg.

virtual bool terimber_aiomsg::get_sender ( const msg_t msg,
guid_t sender 
) const [pure virtual]

gets sender address

Parameters:
msg  pointer to the message
sender  reference where function put sender address to

Implemented in aiomsg.

virtual bool terimber_aiomsg::send ( bool  copy,
msg_t msg,
msg_t **  reply 
) [pure virtual]

function send message and wait the reply for timeout milliseconds (garantee delivery) if function returns false the caller is still responsible for message destruction regardless the copy parameter value

Transport functions

Parameters:
copy  if set to true, the function will make a copy of message and caller can reuse message again
msg  otherwise message port will take care about it pointer to message to be sent, if function returns true and copy == false then message port is responsible for message destruction
reply  returns the reply from receiver, caller is responsible to destroy the reply message

Implemented in aiomsg.

virtual guid_t terimber_aiomsg::send_async ( bool  copy,
msg_t msg 
) [pure virtual]

function sends message asynchronically (guarantee delivery) and returns unique identificator (zero means error) which will be used as input parameter for asynchronous callback function if function returns zero the caller is still responsible for message destruction regardless the copy parameter value retun value, if non zero is unique identificator, which will be used for firing asynchronous reply, see above

Parameters:
copy  if set to true, the function will make a copy of message and caller can reuse message again
msg  otherwise message port will take care about it pointer to message to be sent, if function returns true and copy == false then message port is responsible for message destruction

Implemented in aiomsg.

virtual bool terimber_aiomsg::post ( bool  copy,
msg_t msg 
) [pure virtual]

function posts message and doesn't wait for a reply - this is a non-guarantee delivery if function returns false the caller is still responsible for message destruction regardless the copy parameter value

Parameters:
copy  if set to true, the function will make a copy of message and caller can reuse message again
msg  pointer to message to be sent, if function returns true and copy == false then message port is responsible for message destruction otherwise message port will take care about it

Implemented in aiomsg.

virtual bool terimber_aiomsg::add_connection ( const char *  xml_description  )  [pure virtual]

additional functionality to manage connections dynamically - xml string describes connection as xml node of follow XDTD extended DTD <!ENTITY % kind "(rpc | sock | p2p)"> <!ELEMENT connection EMPTY> <!ATTLIST connection address CTYPE vt_guid REQUIRED port CTYPE vt_ub2 IMPLIED network CDATA IMPLIED ping CTYPE vt_ub4 IMPLIED info CDATA IMPLIED security CTYPE vt_bool IMPLIED password CDATA IMPLIED > encpytion is reserved for production version

Implemented in aiomsg.

virtual bool terimber_aiomsg::add_listener ( const char *  xml_description  )  [pure virtual]

additional functionality to manage listeners dynamically - xml string describes connection as xml node of follow XDTD extended DTD <!ELEMENT listener (accept | reject)?> <!ELEMENT reject (peer)+> <!ELEMENT accept (peer)+> <!ELEMENT peer EMPTY> <!ATTLIST peer address CTYPE vt_guid REQUIRED security CTYPE vt_bool IMPLIED password CDATA IMPLIED > <!ATTLIST listener port CTYPE vt_ub2 IMPLIED network CDATA IMPLIED connections CTYPE vt_ub4 IMPLIED ping CTYPE vt_ub4 IMPLIED waste CTYPE vt_ub4 IMPLIED info CDATA IMPLIED security CTYPE vt_bool IMPLIED password CDATA IMPLIED >

Implemented in aiomsg.

virtual bool terimber_aiomsg::remove_connection ( const guid_t address  )  [pure virtual]

removes connection dynamically

Parameters:
address  address of connection

Implemented in aiomsg.

virtual bool terimber_aiomsg::remove_listener ( const char *  type  )  [pure virtual]

removes listener dynamically

Parameters:
type  type of listener (rpc | sock | p2p)

Implemented in aiomsg.

virtual void terimber_aiomsg::doxray (  )  [pure virtual]

do xray

Implemented in aiomsg.


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


© Copyright Terimber 2003-.