48 #ifndef _MIRA_THREADMONITOR_H_ 49 #define _MIRA_THREADMONITOR_H_ 61 #include <serialization/adapters/std/vector> 172 template<
typename Reflector>
175 r.property(
"ID",
id,
"The native thread id (number)");
176 r.property(
"Name",
name,
"The thread's name");
195 template<
typename Reflector>
198 r.property(
"CreateTime",
create_time,
"Thread creation time, UTC");
199 r.property(
"UserTime",
user_time,
"Time spent in user mode");
200 r.property(
"KernelTime",
kernel_time,
"Time spent in kernel mode");
209 template<
typename TID>
215 template<
typename OtherTID>
220 template<
typename Reflector>
223 r.property(
"Known",
known,
"Thread is registered to the ThreadMonitor?");
224 r.property(
"Identity",
identity,
"Thread identity info");
225 r.template reflectBase<ThreadInfoBase>(*this);
260 typedef std::map<ThreadID, ThreadIdentity> ThreadMap;
262 boost::mutex mThreadsMutex;
Duration kernel_time
The time amount in kernel-mode.
Definition: ThreadMonitor.h:205
void reflect(Reflector &r)
Definition: ThreadMonitor.h:196
bool known
Indicates whether this thread is known by the ThreadMonitor.
Definition: ThreadMonitor.h:228
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
std::vector< BasicThreadInfo > BasicThreadInfoVector
Vector of serializable thread info.
Definition: ThreadMonitor.h:236
Time and Duration wrapper class.
Combine thread identity (template param) and runtime info.
Definition: ThreadMonitor.h:210
uint32 ThreadID
Platform independent thread ID.
Definition: ThreadID.h:64
std::string name
Name of the thread.
Definition: ThreadMonitor.h:180
void removeThisThread()
Remove the calling thread from the monitor.
Provided for convenience.
Definition: Singleton.h:528
ThreadInfoTempl()=default
BasicThreadInfoVector getBasicThreadInformation()
Collect basic (serializable) information about all threads of the current process.
boost::thread::id bid
Boost thread ID.
Definition: ThreadMonitor.h:189
Wrapper class for boost::posix_time::ptime for adding more functionality to it.
Definition: Time.h:418
ThreadInfoTempl(const ThreadInfoTempl< OtherTID > &other)
implement conversion between different identity types
Definition: ThreadMonitor.h:216
OS independent thread id.
TID identity
Thread identity data.
Definition: ThreadMonitor.h:230
Includes, defines and functions for threads.
void reflect(Reflector &r)
Definition: ThreadMonitor.h:173
A singleton class that can be freely configured using policies that control the creation, instantiation, lifetime and thread-safety.
Use this class to represent time durations.
Definition: Time.h:106
void reflect(Reflector &r)
Definition: ThreadMonitor.h:221
std::vector< ThreadInfo > ThreadInfoVector
Vector of local id thread data.
Definition: ThreadMonitor.h:241
Time create_time
Thread creation time in UTC.
Definition: ThreadMonitor.h:203
void removeThread(const boost::thread &pThread)
Remove a thread from the monitor.
ThreadInfoVector getThreadInformation()
Collect information about all threads of the current process.
Serializable thread id.
Definition: ThreadMonitor.h:170
Extend basic thread id by boost thread id (not serializable).
Definition: ThreadMonitor.h:187
ThreadID id
Native thread ID (not boost::thread::native_handle_type!)
Definition: ThreadMonitor.h:179
A thread monitor class.
Definition: ThreadMonitor.h:115
virtual ~ThreadMonitor()
The destructor.
Runtime thread info.
Definition: ThreadMonitor.h:193
void addThisThread(const std::string &pName)
Add the calling thread to the thread monitor.
ThreadMonitor()
Default constructor.
Duration user_time
The time amount in user-mode.
Definition: ThreadMonitor.h:204