AceSmartSoft API Documentation
Public Member Functions | Protected Member Functions | List of all members
SmartACE::Task Class Reference

Base class for active objects. More...

#include <smartTask.hh>

Inheritance diagram for SmartACE::Task:
SmartACE::ManagedTask SmartACE::ReactorTask SmartACE::SIDhandler SmartACE::ThreadQueueQueryHandler< RequestType, AnswerType > SmartACE::StateUpdateThread

Public Member Functions

 Task (Smart::IComponent *component=0)
 Constructor. More...
 
virtual ~Task ()
 Destructor. More...
 
virtual int start ()
 Creates and starts a new thread (if not yet started) More...
 
virtual int start (const ACE_Sched_Params &sched_params, const int &cpuAffinity=-1)
 control method to start the internal thread using given scheduling parameters More...
 
virtual int stop (const bool wait_till_stopped=true)
 Closes currently active thread (if it was started before) More...
 

Protected Member Functions

virtual bool test_canceled ()
 Tests whether the thread has been signaled to stop. More...
 
virtual void sleep_for (const Smart::Duration &rel_time)
 Blocks execution of the calling thread during the span of time specified by rel_time. More...
 
virtual int svc (void)
 implements ACE_Task<ACE_MT_SYNCH> More...
 
int setCpuAffinity (const int &cpuCore)
 
int setSchedParams (const ACE_Sched_Params &sched_params)
 

Detailed Description

Base class for active objects.

Constructor & Destructor Documentation

◆ Task()

SmartACE::Task::Task ( Smart::IComponent *  component = 0)

Constructor.

◆ ~Task()

virtual SmartACE::Task::~Task ( )
virtual

Destructor.

Member Function Documentation

◆ setCpuAffinity()

int SmartACE::Task::setCpuAffinity ( const int &  cpuCore)
protected

◆ setSchedParams()

int SmartACE::Task::setSchedParams ( const ACE_Sched_Params &  sched_params)
protected

◆ sleep_for()

virtual void SmartACE::Task::sleep_for ( const Smart::Duration &  rel_time)
protectedvirtual

Blocks execution of the calling thread during the span of time specified by rel_time.

Thread-sleeping is sometimes platform-specific. This method encapsulates the blocking sleep. Calling this method blocks the execution of the calling thread for a time specified by rel_time.

Parameters
rel_timerelative time duration for the thread to sleep

◆ start() [1/2]

virtual int SmartACE::Task::start ( )
virtual

Creates and starts a new thread (if not yet started)

Reimplemented in SmartACE::ThreadQueueQueryHandler< RequestType, AnswerType >.

◆ start() [2/2]

virtual int SmartACE::Task::start ( const ACE_Sched_Params &  sched_params,
const int &  cpuAffinity = -1 
)
virtual

control method to start the internal thread using given scheduling parameters

◆ stop()

virtual int SmartACE::Task::stop ( const bool  wait_till_stopped = true)
virtual

Closes currently active thread (if it was started before)

Reimplemented in SmartACE::ThreadQueueQueryHandler< RequestType, AnswerType >.

◆ svc()

virtual int SmartACE::Task::svc ( void  )
protectedvirtual

implements ACE_Task<ACE_MT_SYNCH>

◆ test_canceled()

virtual bool SmartACE::Task::test_canceled ( )
protectedvirtual

Tests whether the thread has been signaled to stop.

This method allows to implement cooperative thread stopping.


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