AGX Dynamics  2.37.2.0
PluginManager.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 #ifndef AGXCOLLIDE_PLUGINMANAGER_H
18 #define AGXCOLLIDE_PLUGINMANAGER_H
19 
20 #include <agx/macros.h>
21 
23 
24 #include <agx/agxPhysics_export.h>
25 
26 #include <agx/Singleton.h>
27 
28 
29 #include <agx/Vector.h>
30 #include <agx/HashTable.h>
31 #include <agx/HashSet.h>
32 
33 #include <string>
34 
35 #include <agxCollide/agxCollide.h>
36 
37 #ifdef _MSC_VER
38 # pragma warning(push)
39 # pragma warning( disable : 4251 ) // class X needs to have dll-interface to be used by clients of class Y
40 
41 #else //assume POSIX...
42 #include <dlfcn.h>
43 #include <sys/types.h>
44 #include <dirent.h>
45 #endif
46 
47 
48 namespace agxCollide
49 {
50  class ShapeCollider;
51  class ColliderTable;
52  class Shape;
53  class ShapeColliderPlugin;
54 
55 
56  typedef ShapeCollider* ( *ColliderConstructor )();
57  typedef void ( *ColliderDestructor )( ShapeCollider * );
58 
59  //typedef agx::HashTable<int, ShapeCollider *> ColliderMap;
60 
67  class AGXPHYSICS_EXPORT PluginManager : public agx::Singleton
68  {
69  public:
70  static PluginManager *instance();
71 
72  void registerPlugin(ShapeColliderPlugin *plugin);
73 
74  SINGLETON_CLASSNAME_METHOD();
75 
76  protected:
80  virtual ~PluginManager();
81 
83  virtual void shutdown() override;
84 
85  private:
86 
90  PluginManager();
91 
92 
93  protected:
94  static PluginManager *s_instance;
95  uint32_t m_pluginCount;
96  };
97 
98  typedef agx::ref_ptr<PluginManager> PluginManagerRef;
99 }
101 
102 #ifdef _MSC_VER
103 # pragma warning(pop)
104 #endif
105 
106 #endif
void AGXPHYSICS_EXPORT shutdown()
Shutdown of the AGX Dynamics API will be done when the number of shutdown matches the number of calls...
This namespace consists of a set of classes for handling geometric intersection tests including boole...
#define AGXPHYSICS_EXPORT
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97
Base class for Singletons that should have its shutdown called explicitly before exit of the applicat...
Definition: Singleton.h:30