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

#include <Action.h>

+ Inheritance diagram for commore::Action:

Public Member Functions

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 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 AChar * factory_name ()
 

Detailed Description

Base class for action action is implemeted in the run methode

Member Function Documentation

void commore::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* commore::Action::get_cs ( )
virtual

Specific Action AutoRef critical section protection

Reimplemented from commore::RefObject.

bool commore::Action::is_to_stop ( )

Check action status

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

Clear stop flag

virtual void commore::Action::run ( )
virtual

Run method to be implemented in derived class

void commore::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 commore::Action::submit ( Processor processor)

Submit the action to a processor

int commore::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

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