AGX Dynamics
2.38.0.2
SingletonManager.h
Go to the documentation of this file.
1
/*
2
Copyright 2007-2024. Algoryx Simulation AB.
3
4
All AGX source code, intellectual property, documentation, sample code,
5
tutorials, scene files and technical white papers, are copyrighted, proprietary
6
and confidential material of Algoryx Simulation AB. You may not download, read,
7
store, distribute, publish, copy or otherwise disseminate, use or expose this
8
material unless having a written signed agreement with Algoryx Simulation AB, or having been
9
advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10
valid commercial license from Algoryx Simulation AB.
11
12
Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13
from using this software, unless otherwise stated in written agreements with
14
Algoryx Simulation AB.
15
*/
16
17
#pragma once
18
19
#ifdef _MSC_VER
20
# pragma warning(push)
21
# pragma warning(disable: 4251) // warning C4251: class X needs to have dll-interface to be used by clients of class Y
22
#endif
23
24
25
#include <
agx/agxCore_export.h
>
26
#include <
agx/agx.h
>
27
#include <
agx/Referenced.h
>
28
#include <
agx/ThreadSynchronization.h
>
29
#include <
agx/HashSet.h
>
30
#include <
agx/DynamicLibrary.h
>
31
32
DOXYGEN_START_INTERNAL_BLOCK
()
33
34
namespace
agx
35
{
36
37
class
Singleton;
38
39
41
class
AGXCORE_EXPORT
SingletonManager :
public
agx::Referenced
42
{
43
public
:
44
46
SingletonManager();
47
49
static
SingletonManager* instance();
50
52
void
registerSingleton( Singleton* );
53
54
bool
unregisterSingleton( Singleton* singleton );
55
57
void
shutdown
();
58
60
void
print( )
const
;
61
62
void
registerDynamicLibrary(
agx::DynamicLibrary
*);
63
64
void
unregisterDynamicLibrary(
agx::DynamicLibrary
*);
65
66
protected
:
67
virtual
~SingletonManager();
68
69
private
:
70
typedef
agx::Vector<Singleton*>
SingletonQueue;
71
SingletonQueue m_singletons;
72
SingletonQueue m_addedSingletons;
73
bool
m_dirty;
74
bool
m_shutdownCalled;
75
76
agx::HashSet< agx::ref_ptr<agx::DynamicLibrary>
> m_libraries;
77
78
Mutex
m_mutex
;
79
};
80
81
AGX_DECLARE_POINTER_TYPES
(SingletonManager);
82
}
83
DOXYGEN_END_INTERNAL_BLOCK
()
84
85
#ifdef _MSC_VER
86
# pragma warning(pop)
87
#endif
AGXCORE_EXPORT
#define AGXCORE_EXPORT
Referenced.h
agx::DynamicLibrary
Definition:
DynamicLibrary.h:32
agx::Vector
Templated vector class.
Definition:
Vector.h:52
DynamicLibrary.h
DOXYGEN_END_INTERNAL_BLOCK
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition:
macros.h:97
DOXYGEN_START_INTERNAL_BLOCK
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition:
macros.h:96
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition:
AddedMassInteraction.h:22
agx::shutdown
void AGXPHYSICS_EXPORT shutdown()
Shutdown of the AGX Dynamics API will be done when the number of shutdown matches the number of calls...
agx::Mutex
std::mutex Mutex
Definition:
Referenced.h:99
agx::Referenced::m_mutex
Mutex m_mutex
Definition:
Referenced.h:246
agxCore_export.h
agx::HashSet
Inheritance with partial specialization due to bug with ref_ptr containers.
Definition:
HashSet.h:669
agx.h
HashSet.h
agx::Referenced
Base class providing referencing counted objects.
Definition:
Referenced.h:119
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition:
Referenced.h:254
ThreadSynchronization.h
include
agx
SingletonManager.h
Generated on Sun Sep 1 2024 11:18:56 for AGX Dynamics by
1.8.17