VR-Link API Documentation for HLA 1.3
Home
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vlutil
vlThreadedObject.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 1992-2010 VT MAK
3
** All rights reserved.
4
******************************************************************************/
9
#pragma once
10
11
#include "
vlSmartPointers.h
"
12
#include "
vlThread.h
"
13
#include "
vlRunnable.h
"
14
#include "
vlExceptions.h
"
15
#include "
vlMachineTypes.h
"
16
17
#ifdef DtUSE_UTILITIES_NAMESPACE
18
namespace
DtUSE_UTILITIES_NAMESPACE
19
{
20
#endif
21
22
23
24
typedef
DtBoost::shared_ptr<DtRunnable>
DtRunnableSP
;
25
27
#define typedefException(Name,Value) \
28
const int Name##Number = Value;\
29
typedef DtTemplatedException<Name##Number> Name;
30
const
int
ThreadExceptionBase
= 1000;
31
typedefException
(DtThreadAlreadyRunning,
ThreadExceptionBase
+ 1)
32
typedefException
(DtThreadNotStarted,
ThreadExceptionBase
+ 2)
33
typedefException
(DtThreadCreationError,
ThreadExceptionBase
+ 3)
34
typedefException
(DtThreadWouldDeadlock,
ThreadExceptionBase
+ 4)
35
36
37
class
DT_DLL_VLUTIL
DtThreadedObject
38
{
39
public
:
42
DtThreadedObject();
43
46
DtThreadedObject(
DtRunnableSP
ptr);
47
49
virtual
~DtThreadedObject();
50
56
void
start();
57
60
void
join();
61
65
void
stop(
bool
block);
66
68
bool
running()
const
;
69
72
void
setRunnableObject(
DtRunnableSP
newObject);
73
75
DtRunnableSP
runnableObject()
const
;
76
77
protected
:
78
80
DtThreadedObject(
const
DtThreadedObject&);
81
DtThreadedObject& operator=(
const
DtThreadedObject&);
82
84
void
setRunning(
bool
value);
85
86
bool
myRunningFlag
;
87
DtRunnableSP
myObject
;
88
DtThread
*
myThread
;
89
mutable
DtMutex
myMutex
;
90
};
91
92
93
94
#ifdef DtUSE_UTILITIES_NAMESPACE
95
}
96
#endif
97
98
Document ID: Generated on Mon Jun 22 21:18:40 EDT 2020 from SVN revision 213785
Copyright © 2005-2018 MAK Technologies. All Rights Reserved (
www.mak.com
)