AGXDynamics  2.35.0.2
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 
61  Environment( );
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 
AGXCORE_EXPORT
#define AGXCORE_EXPORT
agxIO::Environment::Type
Type
Specifies which path to access.
Definition: Environment.h:47
agxIO::Environment::COMPONENT_DEV_PATH
@ COMPONENT_DEV_PATH
Specifies paths for where to search for component definitions and source code (only for developers)
Definition: Environment.h:50
DOXYGEN_END_INTERNAL_BLOCK
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
agxIO::FilePathContainer
class for locating files
Definition: FilePathContainer.h:32
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 agx.
agx::Singleton
Base class for Singletons that should have its shutdown called explicitly before exit of the applicat...
Definition: Singleton.h:30
agxIO::Environment::RESOURCE_PATH
@ RESOURCE_PATH
Specifies paths for where to search for resource files such as scripts, images, models etc.
Definition: Environment.h:48
FilePathContainer.h
agxCore_export.h
Singleton.h
agxIO::Environment
Class for setting search path for locating dynamic libraries, scripts etc.
Definition: Environment.h:42
agx::String
AgXString< std::string > String
Definition: String.h:423
agxIO::Environment::RUNTIME_PATH
@ RUNTIME_PATH
Specifies paths for where to search for plugin's/runtime libraries.
Definition: Environment.h:49
agxIO
The agxIO namespace contains classes for reading, writing and finding files.
Definition: Material.h:41
agxStream::ElementTypes::Type
Type
Definition: Types.h:37