This is Unofficial EPICS BASE Doxygen Site
epics::pvData::Thread::Config Class Reference

Create a new thread using the given. More...

#include "thread.h"

Public Member Functions

 Config ()
 
 Config (Runnable *r)
 
 Config (void(*fn)(void *), void *ptr)
 
template<typename C >
 Config (C *inst, void(C::*meth)())
 
Configname (const std::string &n)
 
Configprio (unsigned int p)
 
Configstack (epicsThreadStackSizeClass s)
 
Configautostart (bool a)
 
Configrun (Runnable *r)
 Thread will execute Runnable::run() More...
 
Configrun (void(*fn)(void *), void *ptr)
 Thread will execute (*fn)(ptr) More...
 
template<typename C >
Configrun (C *inst, void(C::*meth)())
 Thread will execute (inst->*meth)() More...
 
template<typename T >
Configoperator<< (T x)
 Append to thread name string. Argument must be understood by std::ostream::operator<<. More...
 

Friends

class Thread
 

Detailed Description

Create a new thread using the given.

be reused.

Defaults: name: "" priority: epicsThreadPriorityLow (aka epics::pvData::lowestPriority) stack size: epicsThreadStackSmall auto start: true runner: nil (must be set explictly)

stuct bar { void meth(); ... } X;
// with a static thread name
Thread foo(Thread::Config(&X, &bar::meth)
.name("example")
// with a constructed thread name
Thread foo(Thread::Config(&X, &bar::meth)
<<"example"<<1);
Exceptions
std::logic_errorfor improper

runner)

Definition at line 95 of file thread.h.

Constructor & Destructor Documentation

epics::pvData::Thread::Config::Config ( )

Definition at line 60 of file thread.cpp.

60 {this->x_setdefault();}
epics::pvData::Thread::Config::Config ( Runnable r)

Definition at line 62 of file thread.cpp.

62 {this->x_setdefault();this->run(r);}
Config & run(Runnable *r)
Thread will execute Runnable::run()
Definition: thread.cpp:82
epics::pvData::Thread::Config::Config ( void(*)(void *)  fn,
void *  ptr 
)

Definition at line 64 of file thread.cpp.

64 {this->x_setdefault();this->run(fn, ptr);}
const ChannelProviderRegistry::factoryfn_t fn
Config & run(Runnable *r)
Thread will execute Runnable::run()
Definition: thread.cpp:82
template<typename C >
epics::pvData::Thread::Config::Config ( C *  inst,
void(C::*)()  meth 
)
inline

Definition at line 112 of file thread.h.

112 {this->x_setdefault();this->run(inst, meth);}
Config & run(Runnable *r)
Thread will execute Runnable::run()
Definition: thread.cpp:82

Member Function Documentation

Thread::Config & epics::pvData::Thread::Config::autostart ( bool  a)

Definition at line 79 of file thread.cpp.

80 { this->p_autostart = a; return *this; }
Thread::Config & epics::pvData::Thread::Config::name ( const std::string &  n)

Definition at line 70 of file thread.cpp.

71 { this->p_strm.str(n); return *this; }
template<typename T >
Config& epics::pvData::Thread::Config::operator<< ( x)
inline

Append to thread name string. Argument must be understood by std::ostream::operator<<.

Definition at line 140 of file thread.h.

140 { this->p_strm<<x; return *this; }
Thread::Config & epics::pvData::Thread::Config::prio ( unsigned int  p)

Definition at line 73 of file thread.cpp.

74 { this->p_prio = p; return *this; }
Thread::Config & epics::pvData::Thread::Config::run ( Runnable r)

Thread will execute Runnable::run()

Definition at line 82 of file thread.cpp.

83 { this->p_runner = r; return *this; }
Thread::Config & epics::pvData::Thread::Config::run ( void(*)(void *)  fn,
void *  ptr 
)

Thread will execute (*fn)(ptr)

Definition at line 85 of file thread.cpp.

86 {
87  this->p_owned_runner.reset(new detail::FuncRunner(fn, ptr));
88  this->p_runner = this->p_owned_runner.get();
89  return *this;
90 }
const ChannelProviderRegistry::factoryfn_t fn
template<typename C >
Config& epics::pvData::Thread::Config::run ( C *  inst,
void(C::*)()  meth 
)
inline

Thread will execute (inst->*meth)()

Definition at line 128 of file thread.h.

129  {
130  this->p_owned_runner.reset(new detail::MethRunner<C>(inst, meth));
131  this->p_runner = this->p_owned_runner.get();
132  return *this;
133  }
Thread::Config & epics::pvData::Thread::Config::stack ( epicsThreadStackSizeClass  s)

Definition at line 76 of file thread.cpp.

77 { this->p_stack = epicsThreadGetStackSize(s); return *this; }
LIBCOM_API unsigned int epicsStdCall epicsThreadGetStackSize(epicsThreadStackSizeClass size)
Definition: osdThread.c:466

Friends And Related Function Documentation

friend class Thread
friend

Definition at line 103 of file thread.h.


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