#include <Pipeline.h>
Definition at line 30 of file Pipeline.h.
Public Types | |
typedef PipelineFilter< _Tp > | PipelineFilterT |
Public Member Functions | |
Pipeline () | |
Mandatory default constructor. | |
~Pipeline () | |
void | shutdown () |
Turns off this Pipeline processing. | |
Reader | write (const _Tp &val) |
void | addFilter (PipelineFilterT *f) |
Adds a new filtering function to the filtering vector. | |
void | operator() () |
void | run () |
Very important You must override this method so you can provide the thread process itself whatever you define this method does, in your subclass is what the thread will start doing when you call start() | |
virtual void | start () |
Call this method when you want to start running your thread, however please note that everytime you call this method, the thread will be spawned again as a totally new instance. | |
virtual void | start (Threading::SchedPolicy pol) |
bool | isRunning () |
Use this method to verify if your thread is running;. | |
void | setPriority (int prio) |
Use this method to set the priority for the current scheduling policy. | |
UInt64 | numericID () |
This method will return a 32 bit integer representing the current thread. | |
UInt64 | numericID () const |
const bool | started () |
const bool | terminated () |
const bool | running () |
const bool | joinable () |
void | join () |
void | registerFinalizer (FinalizerCallback *f_cb) |
Registers a new finalization callback to be called when thread finalizes. | |
void | registerCancellationCB (FinalizerCallback *f_cb) |
Registers a new cancellation callback to be called in the event of thread cancellation only. | |
void | callFinalizers () |
Calls each finalizer in reverse registration order. | |
void | callCancellationCallbacks () |
Calls each cancellation callback in reverse registration order. | |
void | removeCancellationCBs () |
Removes all cancellation callbacks without executing them. | |
virtual const char * | getClassName () |
Returns the name of the current class. | |
virtual std::string | toString () |
Static Public Member Functions | |
static void | debugmsg (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__) |
Will print a debug message to the screen. | |
static void | debugmsgln (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__) |
Public Attributes | |
SharedVar< bool > | _started |
Status flag which determinates if the run method has been called from the thread after calling start. | |
SharedVar< bool > | _terminated |
Status flag which determinates if the run method has finished its execution. | |
Protected Attributes | |
xvr2::Deque< task > | pqueue |
SharedVar< bool > | is_active |
xvr2::Vector< PipelineFilterT * > | filter |
xvr2::Map< Int64, bool, lt > | fones |
A map containing which tasks have been completed. | |
xvr2::Map< Int64, _Tp, lt > | dones |
A map containing filtering results. | |
bool | _detached |
std::deque< FinalizerCallback * > | finalizers |
Doubly-ended queue which stores finalization callbacks. | |
std::deque< FinalizerCallback * > | cancelCBs |
Doubly-ended queue which stores cancellation callbacks. | |
std::string | __cls_name |
Private Types | |
typedef Pipeline< _Tp > | MyPipelineT |
Private Attributes | |
Int64 | id_counter |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const Object &s) |
Classes | |
struct | lt |
class | Reader |
struct | task |
typedef PipelineFilter<_Tp> xvr2::Pipeline< _Tp >::PipelineFilterT |
Definition at line 32 of file Pipeline.h.
typedef Pipeline<_Tp> xvr2::Pipeline< _Tp >::MyPipelineT [private] |
Definition at line 34 of file Pipeline.h.
xvr2::Pipeline< _Tp >::Pipeline | ( | ) | [inline] |
Mandatory default constructor.
Definition at line 106 of file Pipeline.h.
References xvr2::Pipeline< _Tp >::id_counter.
xvr2::Pipeline< _Tp >::~Pipeline | ( | ) | [inline] |
Definition at line 110 of file Pipeline.h.
void xvr2::Pipeline< _Tp >::shutdown | ( | ) | [inline] |
Turns off this Pipeline processing.
Definition at line 115 of file Pipeline.h.
References xvr2::Pipeline< _Tp >::is_active.
Reader xvr2::Pipeline< _Tp >::write | ( | const _Tp & | val | ) | [inline] |
Definition at line 119 of file Pipeline.h.
References xvr2::Pipeline< _Tp >::id_counter, and xvr2::Pipeline< _Tp >::pqueue.
void xvr2::Pipeline< _Tp >::addFilter | ( | PipelineFilterT * | f | ) | [inline] |
Adds a new filtering function to the filtering vector.
Definition at line 128 of file Pipeline.h.
References xvr2::Pipeline< _Tp >::filter.
void xvr2::Pipeline< _Tp >::operator() | ( | void | ) | [inline, virtual] |
Reimplemented from xvr2::Thread.
Definition at line 134 of file Pipeline.h.
References xvr2::Pipeline< _Tp >::dones, xvr2::Pipeline< _Tp >::filter, xvr2::Pipeline< _Tp >::fones, xvr2::SharedVar< T >::getValue(), xvr2::Pipeline< _Tp >::task::id, xvr2::Pipeline< _Tp >::is_active, xvr2::Pipeline< _Tp >::pqueue, and xvr2::Pipeline< _Tp >::task::val.
Referenced by xvr2::Pipeline< _Tp >::run().
void xvr2::Pipeline< _Tp >::run | ( | ) | [inline, virtual] |
Very important
You must override this method so you can provide the thread process itself whatever you define this method does, in your subclass is what the thread will start doing when you call start()
Implements xvr2::Thread.
Definition at line 168 of file Pipeline.h.
References xvr2::Pipeline< _Tp >::operator()().
virtual void xvr2::Thread::start | ( | ) | [virtual, inherited] |
Call this method when you want to start running your thread, however please note that everytime you call this method, the thread will be spawned again as a totally new instance.
virtual void xvr2::Thread::start | ( | Threading::SchedPolicy | pol | ) | [virtual, inherited] |
bool xvr2::Thread::isRunning | ( | ) | [inherited] |
Use this method to verify if your thread is running;.
void xvr2::Thread::setPriority | ( | int | prio | ) | [inherited] |
Use this method to set the priority for the current scheduling policy.
UInt64 xvr2::Thread::numericID | ( | ) | [inherited] |
This method will return a 32 bit integer representing the current thread.
UInt64 xvr2::Thread::numericID | ( | ) | const [inherited] |
const bool xvr2::Thread::started | ( | ) | [inherited] |
const bool xvr2::Thread::terminated | ( | ) | [inherited] |
const bool xvr2::Thread::running | ( | ) | [inherited] |
const bool xvr2::Thread::joinable | ( | ) | [inherited] |
void xvr2::Thread::join | ( | ) | [inherited] |
void xvr2::ThreadFinalizator::registerFinalizer | ( | FinalizerCallback * | f_cb | ) | [inherited] |
Registers a new finalization callback to be called when thread finalizes.
void xvr2::ThreadFinalizator::registerCancellationCB | ( | FinalizerCallback * | f_cb | ) | [inherited] |
Registers a new cancellation callback to be called in the event of thread cancellation only.
void xvr2::ThreadFinalizator::callFinalizers | ( | ) | [inherited] |
Calls each finalizer in reverse registration order.
void xvr2::ThreadFinalizator::callCancellationCallbacks | ( | ) | [inherited] |
Calls each cancellation callback in reverse registration order.
void xvr2::ThreadFinalizator::removeCancellationCBs | ( | ) | [inherited] |
Removes all cancellation callbacks without executing them.
virtual const char* xvr2::Object::getClassName | ( | ) | [virtual, inherited] |
Returns the name of the current class.
static void xvr2::Object::debugmsg | ( | Object * | obj, | |
const char * | msg, | |||
int | linenumber = __LINE__ , |
|||
const char * | srcfile = __FILE__ | |||
) | [static, inherited] |
Will print a debug message to the screen.
static void xvr2::Object::debugmsgln | ( | Object * | obj, | |
const char * | msg, | |||
int | linenumber = __LINE__ , |
|||
const char * | srcfile = __FILE__ | |||
) | [static, inherited] |
virtual std::string xvr2::Object::toString | ( | ) | [virtual, inherited] |
std::ostream& operator<< | ( | std::ostream & | stream, | |
const Object & | s | |||
) | [friend, inherited] |
Int64 xvr2::Pipeline< _Tp >::id_counter [private] |
Definition at line 35 of file Pipeline.h.
Referenced by xvr2::Pipeline< _Tp >::Pipeline(), and xvr2::Pipeline< _Tp >::write().
xvr2::Deque<task> xvr2::Pipeline< _Tp >::pqueue [protected] |
Definition at line 58 of file Pipeline.h.
Referenced by xvr2::Pipeline< _Tp >::operator()(), and xvr2::Pipeline< _Tp >::write().
SharedVar<bool> xvr2::Pipeline< _Tp >::is_active [protected] |
Definition at line 59 of file Pipeline.h.
Referenced by xvr2::Pipeline< _Tp >::operator()(), and xvr2::Pipeline< _Tp >::shutdown().
xvr2::Vector< PipelineFilterT* > xvr2::Pipeline< _Tp >::filter [protected] |
Definition at line 60 of file Pipeline.h.
Referenced by xvr2::Pipeline< _Tp >::addFilter(), and xvr2::Pipeline< _Tp >::operator()().
xvr2::Map<Int64, bool, lt> xvr2::Pipeline< _Tp >::fones [protected] |
A map containing which tasks have been completed.
Definition at line 67 of file Pipeline.h.
Referenced by xvr2::Pipeline< _Tp >::Reader::finished(), and xvr2::Pipeline< _Tp >::operator()().
xvr2::Map<Int64, _Tp, lt> xvr2::Pipeline< _Tp >::dones [protected] |
A map containing filtering results.
Definition at line 69 of file Pipeline.h.
Referenced by xvr2::Pipeline< _Tp >::operator()(), and xvr2::Pipeline< _Tp >::Reader::read().
bool xvr2::Thread::_detached [protected, inherited] |
SharedVar<bool> xvr2::Thread::_started [inherited] |
SharedVar<bool> xvr2::Thread::_terminated [inherited] |
std::deque<FinalizerCallback *> xvr2::ThreadFinalizator::finalizers [protected, inherited] |
Doubly-ended queue which stores finalization callbacks.
Definition at line 27 of file ThreadFinalizator.h.
std::deque<FinalizerCallback *> xvr2::ThreadFinalizator::cancelCBs [protected, inherited] |
Doubly-ended queue which stores cancellation callbacks.
Definition at line 29 of file ThreadFinalizator.h.
std::string xvr2::Object::__cls_name [protected, inherited] |