commore  1.0.6-SNAPSHOT
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SHMListener Class Reference
+ Inheritance diagram for SHMListener:

Public Member Functions

 SHMListener (const char *name, size_t size)
 
 ~SHMListener ()
 
bool start ()
 
bool stop ()
 
bool is_ok ()
 
bool is_stopped ()
 
const AStringget_address () const
 
TimePeriod get_timeout () const
 
void set_timeout (const TimePeriod &timeout)
 
void run ()
 
void set_param (const Tuple &param)
 
Tupleget_param (Tuple &param)
 
int call (const Tuple &inReq, Tuple &outReq)
 
- Public Member Functions inherited from commore::Listener
 Listener ()
 
virtual ~Listener ()
 
virtual void set_callback (Callback &callback)
 
virtual void reset_callback ()
 
- Public Member Functions inherited from commore::RefObject
 RefObject ()
 
virtual ~RefObject ()
 
virtual void attach ()
 
virtual void release ()
 
virtual void nested_attach ()
 
virtual void nested_release ()
 
virtual void interface_release ()
 
virtual void Run ()
 
virtual CriticalSectionget_cs ()
 
- Public Member Functions inherited from commore::Thread
 Thread ()
 
virtual ~Thread ()
 
bool start ()
 
bool request_stop ()
 
bool stop ()
 
bool is_to_stop ()
 
bool is_stopped ()
 
bool is_running ()
 
bool wait (TimePeriod timeout)
 
bool trigger ()
 
virtual void run_item ()
 
- Public Member Functions inherited from SHMPipe
 SHMPipe (const char *name, bool isServer, size_t size)
 
size_t get_file_map_size () const
 
 ~SHMPipe ()
 
void close ()
 
unsigned int get_pid () const
 
const AStringname () const
 
void signal_data_wrote (bool close=false)
 
void signal_data_read ()
 
bool wait_for_data_wrote (const TimePeriod &timeout)
 
bool wait_for_data_read (const TimePeriod &timeout)
 
MemoryBufferget_buff () const
 
void reset ()
 
bool receive_buffer (CommBuffer &buf, const TimePeriod &timeout)
 
bool send_buffer (CommBuffer &buf, const TimePeriod &timeout)
 
bool send_receive (CommBuffer &inBuf, CommBuffer &outBuf, const TimePeriod &timeout)
 
bool is_ok ()
 
bool created ()
 

Additional Inherited Members

- Static Public Member Functions inherited from commore::Listener
static const ACharfactory_name ()
 
- Static Public Member Functions inherited from commore::RefObject
static AutoRefBase auto_create ()
 
static AutoRefBase auto_create (const AChar *s)
 
static AutoRefBase create ()
 
static AutoRefBase create (const AChar *s)
 
static AutoRefBase bind ()
 
static AutoRefBase bind (const AChar *s)
 
static const ACharfactory_name ()
 
- Protected Attributes inherited from commore::Listener
Callbackcallback_
 
- Protected Attributes inherited from SHMPipe
Event event_data_read_by_client_
 
Event event_data_read_by_server_
 
Event event_data_wrote_by_client_
 
Event event_data_wrote_by_server_
 

Constructor & Destructor Documentation

SHMListener::SHMListener ( const char *  name,
size_t  size 
)
inline
SHMListener::~SHMListener ( )
inline

Member Function Documentation

int SHMListener::call ( const Tuple inReq,
Tuple outReq 
)
inline
const AString& SHMListener::get_address ( ) const
inlinevirtual
Returns
the encoded address of listener ! as it must appear in the sender spec address field.

Implements commore::Listener.

Tuple& SHMListener::get_param ( Tuple param)
inlinevirtual

Reimplemented from commore::Listener.

TimePeriod SHMListener::get_timeout ( ) const
inline
bool SHMListener::is_ok ( )
inlinevirtual

Check listener integrity Implementation return here possible invalid state

Returns
true if listener is ok

Reimplemented from commore::Listener.

bool SHMListener::is_stopped ( )
inlinevirtual
Returns
true if listener is listening

Reimplemented from commore::Listener.

void SHMListener::run ( )
inlinevirtual

The main thread function. The method is call on start method by created system thread. The thread terminate when this method end. Must be implemented by derived class.

Remarks
The implementation must constantly check the stop flag to allow graceful stop.

Reimplemented from commore::Thread.

void SHMListener::set_param ( const Tuple param)
inlinevirtual

Param management

Reimplemented from commore::Listener.

void SHMListener::set_timeout ( const TimePeriod timeout)
inline
bool SHMListener::start ( )
inlinevirtual

Start listen, notice that start is automaticaly called when object is created.

Returns
true if lstener is started

Reimplemented from commore::Listener.

bool SHMListener::stop ( )
inlinevirtual

Stop listen Finish current call, close connections, and does not accept new connection any more.

Returns
true if lstener is stopped

Reimplemented from commore::Listener.


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