AGX Dynamics  2.35.0.1
Environment.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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 AGXIO_ENVIRONMENT_H
18 #define AGXIO_ENVIRONMENT_H
19 
20 #include <agx/agxCore_export.h>
22 #include <agx/Singleton.h>
23 
24 namespace agxIO
25 {
43  {
44  public:
45 
47  enum Type {
52  NUM_TYPES
53  };
54 
62 
64  static Environment* instance( void );
65 
69  agxIO::FilePathContainer& getFilePath( Type t = RESOURCE_PATH );
70 
74  const agxIO::FilePathContainer& getFilePath( Type t = RESOURCE_PATH ) const;
75 
77 
78 
79  agx::String findComponent(const agx::String& path) const;
80 
86  bool setupFromRegistry();
87 
88  SINGLETON_CLASSNAME_METHOD();
90 
91 
92  protected:
93  void shutdown() override;
94 
95  agxIO::FilePathContainer m_filePathContainer[NUM_TYPES];
96  static Environment* s_instance;
97  };
98 
100 #define AGX_ENVIRONMENT() (*agxIO::Environment::instance())
101 }
102 
103 #endif
104 
#define AGXCORE_EXPORT
Class for setting search path for locating dynamic libraries, scripts etc.
Definition: Environment.h:43
Environment()
Constructor that will initialize the FilePathContainer with data:
Type
Specifies which path to access.
Definition: Environment.h:47
@ COMPONENT_DEV_PATH
Specifies paths for where to search for component definitions and source code (only for developers)
Definition: Environment.h:50
@ RUNTIME_PATH
Specifies paths for where to search for plugin's/runtime libraries.
Definition: Environment.h:49
@ RESOURCE_PATH
Specifies paths for where to search for resource files such as scripts, images, models etc.
Definition: Environment.h:48
agxIO::FilePathContainer & getFilePath(Type t=RESOURCE_PATH)
const agxIO::FilePathContainer & getFilePath(Type t=RESOURCE_PATH) const
static Environment * instance(void)
class for locating files
Base class for Singletons that should have its shutdown called explicitly before exit of the applicat...
Definition: Singleton.h:31
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
The agxIO namespace contains classes for reading, writing and finding files.
Definition: Material.h:42
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
AgXString< std::string > String
Definition: String.h:423
void AGXPHYSICS_EXPORT shutdown()
Shutdown agx.