16#if __cplusplus>=201103L
20#include <epicsThread.h>
23#include <pv/noDefaultMethods.h>
27namespace 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
40typedef std::tr1::shared_ptr<Thread> ThreadPtr;
41typedef std::tr1::shared_ptr<epicsThread> EpicsThreadPtr;
43typedef epicsThreadRunable Runnable;
49 typedef void(C::*fn_t)();
65class epicsShareClass
Thread :
public epicsThread {
97 unsigned int p_prio, p_stack;
98 std::ostringstream p_strm;
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);
117 Config& name(
const std::string& n);
118 Config& prio(
unsigned int p);
119 Config& stack(epicsThreadStackSizeClass s);
120 Config& autostart(
bool a);
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;
void reset(element_type *__p=0)
element_type * get() const
Holds all the configuration necessary to launch a.
Create a new thread using the given.
Config & run(C *inst, void(C::*meth)())
Thread will execute (inst->*meth)()
Config & operator<<(T x)
Append to thread name string. Argument must be understood by std::ostream::operator<<.
Config & run(void(*fn)(void *), void *ptr)
Thread will execute (*fn)(ptr)
Config & run(Runnable *r)
Thread will execute Runnable::run()
C++ wrapper for epicsThread from EPICS base.
Thread(std::string name, ThreadPriority priority, Runnable *runnable, epicsThreadStackSizeClass stkcls=epicsThreadStackBig)