MAK RTIspy API Documentation for HLA 1516
Home
Modules
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
libsrc
rtiutil
vlThreadedObject.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2005 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
/******************************************************************************
6
** $RCSfile: vlThreadedObject.h,v $ $Revision: 1.3 $ $State: Exp $
7
******************************************************************************/
8
12
13
14
#ifndef vlThreadedObject_H__
15
#define vlThreadedObject_H__
16
17
#include "
rtiMsConfig.h
"
18
#include <vlutil/vlSmartPointers.h>
19
#include <vlutil/vlThread.h>
20
#include <vlutil/vlRunnable.h>
21
#include <vlutil/vlMutex.h>
22
#include <vlutil/vlExceptions.h>
23
#include <vlutil/vlMachineTypes.h>
24
25
typedef
DtBoost::shared_ptr<MAKRti::DtRunnable>
DtRunnableSP
;
26
27
namespace
vrlmod
28
{
29
30
31
32
33
35
#define typedefException(Name,Value) \
36
const int Name##Number = Value;\
37
typedef MAKRti::DtTemplatedException<Name##Number> Name;
38
const
int
ThreadExceptionBase
= 1000;
39
typedefException
(DtThreadAlreadyRunning,
ThreadExceptionBase
+ 1)
40
typedefException
(DtThreadNotStarted,
ThreadExceptionBase
+ 2)
41
typedefException
(DtThreadCreationError,
ThreadExceptionBase
+ 3)
42
typedefException
(DtThreadWouldDeadlock,
ThreadExceptionBase
+ 4)
43
44
45
class
DT_DLL_RTIUTIL
DtThreadedObject
46
{
47
public
:
50
DtThreadedObject();
51
54
DtThreadedObject(
DtRunnableSP
ptr);
55
57
virtual
~DtThreadedObject();
58
64
void
start();
65
68
void
join();
69
73
void
stop(
bool
block);
74
76
bool
running()
const
;
77
80
void
setRunnableObject(
DtRunnableSP
newObject);
81
83
DtRunnableSP
runnableObject()
const
;
84
85
protected
:
86
88
DtThreadedObject(
const
DtThreadedObject&);
89
DtThreadedObject& operator=(
const
DtThreadedObject&);
90
92
void
setRunning(
bool
value);
93
94
bool
myRunningFlag
;
95
DtRunnableSP
myObject
;
96
MAKRti::DtThread*
myThread
;
97
mutable
MAKRti::DtMutex
myMutex
;
98
};
99
100
101
102
103
}
104
105
106
107
#endif
Document ID: Generated on Fri Mar 14 19:08:55 EDT 2014 from SVN revision 137085
Copyright © 2005-2014 VT MÄK Inc. All Rights Reserved (
www.mak.com
)