Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef ORO_ACTIVITY_INTERFACE_HPP
00039 #define ORO_ACTIVITY_INTERFACE_HPP
00040
00041 #include "../Time.hpp"
00042 #include "../os/ThreadInterface.hpp"
00043 #include <boost/shared_ptr.hpp>
00044 #include "rtt-base-fwd.hpp"
00045
00046 namespace RTT
00047 { namespace base {
00048
00062 class RTT_API ActivityInterface
00063 {
00064 protected:
00065 RunnableInterface* runner;
00066
00073 void disableRun(RunnableInterface* caller) { if (caller == runner) runner = 0; }
00074 public:
00075 friend class RunnableInterface;
00076
00077 typedef boost::shared_ptr<ActivityInterface> shared_ptr;
00078
00079 ActivityInterface() : runner(0) {}
00080
00081 ActivityInterface(RunnableInterface* run);
00082
00083 virtual ~ActivityInterface();
00084
00092 virtual bool run( RunnableInterface* r );
00093
00104 virtual bool start() = 0;
00105
00115 virtual bool stop() = 0;
00116
00128 virtual bool isRunning() const = 0;
00129
00138 virtual bool isActive() const = 0;
00139
00145 virtual Seconds getPeriod() const = 0;
00146
00153 virtual bool isPeriodic() const = 0;
00154
00162 virtual bool setPeriod(Seconds s) = 0;
00163
00164
00170 virtual unsigned getCpuAffinity() const = 0;
00171
00176 virtual bool setCpuAffinity(unsigned cpu) = 0;
00177
00193 virtual bool execute() = 0;
00194
00212 virtual bool trigger() = 0;
00213
00218 virtual os::ThreadInterface* thread() = 0;
00219
00223 virtual RunnableInterface* getRunner() const;
00224 };
00225
00226 }}
00227
00228 #endif