Trippin Cyril
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Member Functions | List of all members
trippingcyril::thread::Thread Class Referenceabstract

Simple thread class. More...

#include <Thread.h>

Inheritance diagram for trippingcyril::thread::Thread:
[legend]
Collaboration diagram for trippingcyril::thread::Thread:
[legend]

Public Member Functions

 Thread (const String &pName, const Module *pModule)
 
virtual ~Thread ()
 
bool Start ()
 Starts the thread. More...
 
bool Join ()
 Does a join operation on the thread. More...
 
bool Detach ()
 Does a detach operation on the thread. More...
 
pthread_t Self () const
 Get the internal thread id. More...
 
void Stop ()
 Tells the thread to stop. More...
 
bool isRunning () const
 See if the thread is running or not. More...
 
void * getReturnedValue () const
 Receive the value returned from the thread after a Join operation. More...
 
const String GetName () const
 Receive the name of the thread. More...
 
- Public Member Functions inherited from trippingcyril::trippingcyril::Event
 Event (const Module *module)
 
virtual ~Event ()
 
const ModuleGetModule () const
 

Protected Member Functions

virtual void * run ()=0
 The method that is actually executed on the thread, override this. More...
 
bool shouldContinue () const
 Receive a hint about what you should do, continue or not? Depends mostly on the internal stop value set by Stop. More...
 
- Protected Member Functions inherited from trippingcyril::trippingcyril::Event
event_base * GetEventBase () const
 
evdns_base * GetDNSBase () const
 

Additional Inherited Members

- Protected Attributes inherited from trippingcyril::trippingcyril::Event
const Modulemodule
 

Detailed Description

Simple thread class.

Constructor & Destructor Documentation

trippingcyril::thread::Thread::Thread ( const String pName,
const Module pModule 
)

Standard constructor

Parameters
pModuleThe module to register this thread on
pNameThe name the thread will get
virtual trippingcyril::thread::Thread::~Thread ( )
virtual

Standard deconstructor

Member Function Documentation

bool trippingcyril::thread::Thread::Detach ( )

Does a detach operation on the thread.

Returns
True if succesfull
const String trippingcyril::thread::Thread::GetName ( ) const
inline

Receive the name of the thread.

void* trippingcyril::thread::Thread::getReturnedValue ( ) const
inline

Receive the value returned from the thread after a Join operation.

bool trippingcyril::thread::Thread::isRunning ( ) const
inline

See if the thread is running or not.

Returns
True if the thread is running
bool trippingcyril::thread::Thread::Join ( )

Does a join operation on the thread.

Returns
True if succesfull
virtual void* trippingcyril::thread::Thread::run ( )
protectedpure virtual

The method that is actually executed on the thread, override this.

Implemented in trippingcyril::thread::JobThread, and trippingcyril::ModuleThread.

pthread_t trippingcyril::thread::Thread::Self ( ) const
inline

Get the internal thread id.

Returns
The pthread id of the running thread, 0 if not yet running
bool trippingcyril::thread::Thread::shouldContinue ( ) const
protected

Receive a hint about what you should do, continue or not? Depends mostly on the internal stop value set by Stop.

Returns
True if you should not stop
bool trippingcyril::thread::Thread::Start ( )

Starts the thread.

Returns
True if thread succesfully started
void trippingcyril::thread::Thread::Stop ( )

Tells the thread to stop.

See Also
shouldContinue

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