cumbia-tango 1.x
C++ multi threaded library based on cumbia and the Tango control system
cutthreadtokengen.h
Go to the documentation of this file.
1#ifndef CUTTHREADTOKENGEN_H
2#define CUTTHREADTOKENGEN_H
3
4#include <cuthreadtokengeni.h>
5#include <list>
6#include <string>
7
8class CuTThreadTokenGenPrivate;
9
33class CuTThreadTokenGen : public CuThreadTokenGenI
34{
35public:
36 CuTThreadTokenGen(int pool_siz, const std::string& tok_prefix = "tthread_");
37
39
40 // CuThreadTokenGenI interface
41 std::string generate(const std::string& dev);
42
43 void map(const std::string &device, int which);
44
45 int which_thread(const std::string &device) const;
46
47 int which_from_token(const std::string& tok) const;
48
49 std::list<std::string> devicesForToken(const std::string& token) const;
50
51 std::string tok_prefix() const;
52
53 int threadPoolSize() const;
54
55 void setThreadPoolSize(int siz);
56
57private:
58 CuTThreadTokenGenPrivate *d;
59};
60
61#endif // CUTTHREADTOKENGEN_H
Thread token generator for Tango sources.
Definition cutthreadtokengen.h:34
std::list< std::string > devicesForToken(const std::string &token) const
Returns the list of devices whose sources belong to the thread with the given token.
Definition cutthreadtokengen.cpp:141
int which_thread(const std::string &device) const
CuTThreadTokenGen::which_thread returns which thread has been assigned to the given device.
Definition cutthreadtokengen.cpp:108
void setThreadPoolSize(int siz)
CuTThreadTokenGen::setThreadPoolSize change the thread pool size.
Definition cutthreadtokengen.cpp:191
CuTThreadTokenGen(int pool_siz, const std::string &tok_prefix="tthread_")
CuTThreadTokenGen::CuTThreadTokenGen constructor.
Definition cutthreadtokengen.cpp:30
~CuTThreadTokenGen()
Definition cutthreadtokengen.cpp:37
int threadPoolSize() const
CuTThreadTokenGen::threadPoolSize returns the upper limit on the number of threads created and manage...
Definition cutthreadtokengen.cpp:175
std::string generate(const std::string &dev)
This function implements the CuThreadTokenI::generate method and is invoked by Cumbia::threadToken fu...
Definition cutthreadtokengen.cpp:64
int which_from_token(const std::string &tok) const
Removes the prefix from tok and returns the.
Definition cutthreadtokengen.cpp:123
std::string tok_prefix() const
Returns the prefix used for the token name.
Definition cutthreadtokengen.cpp:165
void map(const std::string &device, int which)
User defined associations between device names and thread number.
Definition cutthreadtokengen.cpp:94