AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxIO::Environment Class Reference

Class for setting search path for locating dynamic libraries, scripts etc. More...

#include <Environment.h>

+ Inheritance diagram for agxIO::Environment:

Public Types

enum  Type { RESOURCE_PATH , RUNTIME_PATH , COMPONENT_DEV_PATH , NUM_TYPES }
 Specifies which path to access. More...
 
- Public Types inherited from agx::Singleton
enum  Priority { HIGHEST_PRIORITY = 2147483647 , LOWEST_PRIORITY = 10000 , DEFAULT_PRIORITY = 1073741824 }
 Specifies the ranges of the priority which can be assigned to a singleton at the time of creation. More...
 

Public Member Functions

 Environment ()
 Constructor that will initialize the FilePathContainer with data:
 
agxIO::FilePathContainer & getFilePath (Type t=RESOURCE_PATH)
 
const agxIO::FilePathContainer & getFilePath (Type t=RESOURCE_PATH) const
 
- Public Member Functions inherited from agx::Singleton
 Singleton (int priority=DEFAULT_PRIORITY)
 Default constructor.
 
virtual std::string getClassName () const =0
 
int getPriority () const
 Return the shutdown priority of the singleton instance.
 
virtual void shutdown ()=0
 Implement this method to cleanup your Singleton class.
 

Static Public Member Functions

static Environment * instance (void)
 

Protected Member Functions

void shutdown () override
 Implement this method to cleanup your Singleton class.
 
- Protected Member Functions inherited from agx::Singleton
virtual ~Singleton ()
 Destructor.
 
void _shutdown ()
 

Protected Attributes

agxIO::FilePathContainer m_filePathContainer [NUM_TYPES]
 

Static Protected Attributes

static Environment * s_instance
 

Detailed Description

Class for setting search path for locating dynamic libraries, scripts etc.

Environment has three paths, of which user should use: RESOURCE_PATH and RUNTIME_PATH

RESOURCE_PATH - lists directories where AGX can find license files, kernel files, configuration files and scripts. BINARY_PATH - lists directories where AGX should search for collider plugins, kernel binaries etc.

// Tell AGX where to find some additional scripts.
// Point out where to find plugins
agxIO::FilePathContainer & getFilePath(Type t=RESOURCE_PATH)
@ RUNTIME_PATH
Specifies paths for where to search for plugin's/runtime libraries.
@ RESOURCE_PATH
Specifies paths for where to search for resource files such as scripts, images, models etc.
static Environment * instance(void)
void addFilePath(const agx::String &path)
Adds a list of paths to the end previous one.

Definition at line 41 of file agxIO/Environment.h.

Member Enumeration Documentation

◆ Type

Specifies which path to access.

Enumerator
RESOURCE_PATH 

Specifies paths for where to search for resource files such as scripts, images, models etc.

RUNTIME_PATH 

Specifies paths for where to search for plugin's/runtime libraries.

COMPONENT_DEV_PATH 

Specifies paths for where to search for component definitions and source code (only for developers)

NUM_TYPES 

Definition at line 46 of file agxIO/Environment.h.

Constructor & Destructor Documentation

◆ Environment()

agxIO::Environment::Environment ( )

Constructor that will initialize the FilePathContainer with data:

RESOURCE_PATH: Paths from the environment variable AGX_FILE_PATH RUNTIME_PATH: Paths from the environment variable PATH/LD_LIBRARY_PATH

Member Function Documentation

◆ getFilePath() [1/2]

agxIO::FilePathContainer & agxIO::Environment::getFilePath ( Type  t = RESOURCE_PATH)
Returns
reference to the FilePathContainer for finding files given the current setup filepath:s.

◆ getFilePath() [2/2]

const agxIO::FilePathContainer & agxIO::Environment::getFilePath ( Type  t = RESOURCE_PATH) const
Returns
a const reference to the FilePathContainer for finding files given the current setup filepath:s.

◆ instance()

static Environment * agxIO::Environment::instance ( void  )
static
Returns
a pointer to the Environment singleton.

◆ shutdown()

void agxIO::Environment::shutdown ( )
overrideprotectedvirtual

Implement this method to cleanup your Singleton class.

Implements agx::Singleton.

Member Data Documentation

◆ m_filePathContainer

agxIO::FilePathContainer agxIO::Environment::m_filePathContainer[NUM_TYPES]
protected

Definition at line 94 of file agxIO/Environment.h.

◆ s_instance

Environment* agxIO::Environment::s_instance
staticprotected

Definition at line 95 of file agxIO/Environment.h.


The documentation for this class was generated from the following file: