Orocos Real-Time Toolkit  2.9.0
OperationCallerInterface.cpp
Go to the documentation of this file.
2 #include "../internal/GlobalEngine.hpp"
3 
4 using namespace RTT;
5 using namespace base;
6 using namespace internal;
7 
9  : myengine(0), caller(0), met(ClientThread)
10 {}
11 
13  : myengine(orig.myengine), caller(orig.caller), met(orig.met)
14 {}
15 
17 {
18 }
19 
21  myengine = ee;
22 }
23 
25  caller = ee;
26 }
27 
29  met = et;
30  setOwner(executor);
31  return true;
32 }
33 
35 {
36  if ( met == ClientThread ) return false;
37  // OwnThread case:
38  if ( myengine->isSelf() ) return false;
39  return true; // all other OwnThread cases
40 }
41 
43 {
45  if (ret == 0 )
46  return GlobalEngine::Instance(); // best-effort for Operations not tied to an EE
47  return ret;
48 }
49 
50 
51 // report an error if an exception was thrown while calling exec()
53  // This localOperation was added to a TaskContext or to a Service owned by a TaskContext
54  if (this->myengine != 0)
55  this->myengine->setExceptionTask();
56 }
57 
The interface class for operation callers.
bool isSelf() const
Check if the thread that processes messages send to this engine is the same as the calling thread...
bool setThread(ExecutionThread et, ExecutionEngine *executor)
Sets the Thread execution policy of this object.
virtual void setCaller(ExecutionEngine *ee)
Sets the caller's engine of this operation.
bool isSend()
Helpful function to tell us if this operations is to be sent or not.
void reportError()
Executed when the operation execution resulted in a C++ exception.
An execution engine serialises (executes one after the other) the execution of all commands...
OperationCallerInterface()
Initializes an empty OperationCallerInterface with owner, executor and caller set to zero and the Exe...
virtual void setOwner(ExecutionEngine *ee)
Set the ExecutionEngine of the task which owns this method.
static RTT_API ExecutionEngine * Instance()
This is an overloaded member function, provided for convenience. It differs from the above function o...
ExecutionEngine * getMessageProcessor() const
void setExceptionTask()
Set the 'owner' task in the exception state.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:52
ExecutionThread
Users can choose if an operation's function is executed in the component's thread (OwnThread) or in t...