16 #if __cplusplus>=201103L
20 #include <epicsThread.h>
23 #include <pv/noDefaultMethods.h>
24 #include <pv/pvType.h>
27 namespace epics {
namespace pvData {
30 lowestPriority =epicsThreadPriorityLow,
31 lowerPriority =epicsThreadPriorityLow + 15,
32 lowPriority =epicsThreadPriorityMedium - 15,
33 middlePriority =epicsThreadPriorityMedium,
34 highPriority =epicsThreadPriorityMedium + 15,
35 higherPriority =epicsThreadPriorityHigh - 15,
36 highestPriority =epicsThreadPriorityHigh
40 typedef std::tr1::shared_ptr<Thread> ThreadPtr;
41 typedef std::tr1::shared_ptr<epicsThread> EpicsThreadPtr;
43 typedef epicsThreadRunable Runnable;
49 typedef void(C::*fn_t)();
65 class epicsShareClass
Thread :
public epicsThread {
97 unsigned int p_prio, p_stack;
104 Runnable& x_getrunner();
110 Config(
void(*fn)(
void*),
void *ptr);
112 Config(C* inst,
void(C::*meth)()) {this->x_setdefault();this->run(inst, meth);}
113 #if __cplusplus>=201103L
114 Config(std::function<
void()>&& fn);
118 Config& prio(
unsigned int p);
119 Config& stack(epicsThreadStackSizeClass s);
120 Config& autostart(
bool a);
125 Config& run(
void(*fn)(
void*),
void *ptr);
131 this->p_runner = this->p_owned_runner.get();
134 #if __cplusplus>=201103L
135 Config& run(std::function<
void()>&& fn);
159 ThreadPriority priority,
161 epicsThreadStackSizeClass stkcls=epicsThreadStackBig);
178 Thread(Runnable &runnable,
180 unsigned int stksize,
181 unsigned int priority=lowestPriority);
192 static size_t num_instances;
194 Config::p_owned_runner_t p_owned;
Config & run(C *inst, void(C::*meth)())
Thread will execute (inst->*meth)()
Holds all the configuration necessary to launch aThe defaults may be used except for the runnable...
Config & operator<<(T x)
Append to thread name string. Argument must be understood by std::ostream::operator<<.
Create a new thread using the given.
C++ wrapper for epicsThread from EPICS base.