commore  1.0.6-SNAPSHOT
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
commore::Action Class Reference

#include <Action.h>

+ Inheritance diagram for commore::Action:

Classes

struct  Impl
 

Public Member Functions

 Action ()
 
virtual ~Action ()
 
virtual void run ()
 
void submit (Processor &processor)
 
void stop (Processor &processor, bool wait=true)
 
void abort (Processor &processor, bool wait=true)
 
bool is_to_stop ()
 
bool is_to_abort ()
 
bool is_running ()
 
bool is_stopped ()
 
int wait (Processor &processor, const int timeout_ms=0)
 
void reset ()
 
commore::CriticalSectionget_cs ()
 
- 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 ()
 

Friends

class ProcessorImpl
 
class ThreadItem
 
struct ThreadActor
 

Additional Inherited Members

- 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 ()
 

Detailed Description

Base class for action action is implemeted in the run methode

Constructor & Destructor Documentation

Action::Action ( )
Action::~Action ( )
virtual

Member Function Documentation

void Action::abort ( Processor processor,
bool  wait = true 
)

Set action abort flag if not wait the pending queue is flushed

Parameters
processorwhere action is submitted
waitif true wait action terminate
Todo:
rename to set_to_abort
commore::CriticalSection * Action::get_cs ( )
virtual

Specific Action AutoRef critical section protection

Reimplemented from commore::RefObject.

bool Action::is_running ( )
bool Action::is_stopped ( )
bool Action::is_to_abort ( )
bool Action::is_to_stop ( )

Check action status

Remarks
are these methods realy used
void Action::reset ( )

Clear stop flag

void Action::run ( )
virtual

Run method to be implemented in derived class

Reimplemented in ConnectionAction, ProcessFunctionAction, and Socket.

void Action::stop ( Processor processor,
bool  wait = true 
)

Set action stop flag if not wait the pending queue is flushed

Parameters
processorwhere action is submitted
waitif true wait action terminate
Todo:
rename to set_to_stop
void Action::submit ( Processor processor)

Submit the action to a processor

int Action::wait ( Processor processor,
const int  timeout_ms = 0 
)

Wait action terminate

Parameters
processorwhere action is submited
timeout_mstimeout in milliseconds
Returns
1 if action is terminated, 0 if tiemout
Todo:
use TimePeriod for timeout value, should return bool

Friends And Related Function Documentation

friend class ProcessorImpl
friend
friend struct ThreadActor
friend
friend class ThreadItem
friend

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