Documentation for OpenFLUID 2.2.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openfluid::base::RunContextManager Class Reference

#include <base/RunContextManager.hpp>

Public Member Functions

std::string getInputDir () const
 
std::string getInputFullPath (const std::string &Filename) const
 
void setInputDir (const std::string &InputDir)
 
std::string getOutputDir () const
 
std::string getOutputFullPath (const std::string &Filename) const
 
void setOutputDir (const std::string &OutputDir)
 
void setDateTimeOutputDir ()
 
bool isClearOutputDir () const
 
void setClearOutputDir (bool Enabled)
 
bool isProfiling () const
 
void setProfiling (bool Enabled)
 
unsigned int getValuesBufferUserSize () const
 
void setValuesBufferUserSize (unsigned int Size)
 
void unsetValuesBufferUserSize ()
 
bool isValuesBufferUserSize () const
 
unsigned int getWaresMaxNumThreads () const
 
void setWaresMaxNumThreads (unsigned int Num)
 
void resetWaresMaxNumThreads ()
 
openfluid::core::MapValueextraProperties ()
 
const openfluid::core::MapValuegetWaresEnvironment () const
 
void processWareParams (openfluid::ware::WareParams_t &Params) const
 
std::string getProjectPath () const
 
std::string getProjectName () const
 
void setProjectName (const std::string &Name)
 
std::string getProjectDescription () const
 
void setProjectDescription (const std::string &Description)
 
std::string getProjectAuthors () const
 
void setProjectAuthors (const std::string &Authors)
 
std::string getProjectCreationDate () const
 
void setProjectCreationDate (const std::string &CreationDate)
 
void setProjectCreationDateAsNow ()
 
std::string getProjectLastModDate () const
 
void setProjectLastModDate (const std::string &LastModDate)
 
bool isProjectIncrementalOutputDir () const
 
void setProjectIncrementalOutputDir (const bool Inc)
 
bool openProject (const std::string &Path)
 
bool createProject (const std::string &Path, const std::string &Name, const std::string &Description, const std::string &Authors, const bool Inc)
 
bool isProjectOpen () const
 
bool saveProject ()
 
void closeProject ()
 
void updateProjectOutputDir ()
 
openfluid::tools::SettingValue getProjectContextValue (const std::string &Pointer) const
 
openfluid::tools::SettingValue getProjectContextValue (const std::string &ParentPointer, const std::string &Key) const
 
void removeProjectContextValue (const std::string &Pointer)
 
void setProjectContextValue (const std::string &ParentPointer, const std::string &Key, const openfluid::tools::SettingValue &Value)
 

Static Public Member Functions

static bool isProject (const std::string &Path)
 
static bool getProjectInfos (const std::string &Path, std::string &Name, std::string &Description, std::string &Authors, std::string &CreationDate, std::string &LastModDate)
 
static bool projectContainsDeprecatedFile (const std::string &Path)
 
- Static Public Member Functions inherited from openfluid::base::Environment
static void init ()
 
static std::string getHostName ()
 
static std::string getSystemArch ()
 
static int getIdealThreadCount ()
 
static int getIdealJobsCount ()
 
static std::string getUserName ()
 
static std::string getVersion ()
 
static std::string getVersionFull ()
 
static std::string getVersionMajorMinor ()
 
static std::string getTempDir ()
 
static std::string getInstallPrefix ()
 
static std::string getUserHomeDir ()
 
static std::string getUserDataDir ()
 
static std::string getUserDataFullPath (const std::string &Path)
 
static std::string getUserExamplesDir ()
 
static std::string getUserExampleSimulatorsDir ()
 
static std::string getProvidedExamplesDir ()
 
static void prepareUserDataDirectory ()
 
static std::string getSettingsFile ()
 
static std::string getTranslationsDir ()
 
static std::string getCommonResourcesDir ()
 
static std::string getCommonResourcesFullPath (const std::string &Path)
 
static std::string getAppResourcesDir (const std::string &AppName)
 
static std::string getAppResourcesFullPath (const std::string &AppName, const std::string &Path)
 
static std::vector< std::string > getSimulatorsDirs ()
 
static std::vector< std::string > getDefaultSimulatorsDirs ()
 
static std::vector< std::string > getExtraSimulatorsDirs ()
 
static void addExtraSimulatorsDirs (const std::string &Paths)
 
static void resetExtraSimulatorsDirs ()
 
static std::string getSimulatorFullPath (const std::string &Filename)
 
static std::vector< std::string > getObserversDirs ()
 
static std::vector< std::string > getDefaultObserversDirs ()
 
static std::vector< std::string > getExtraObserversDirs ()
 
static void addExtraObserversDirs (const std::string &Paths)
 
static void resetExtraObserversDirs ()
 
static std::string getObserverFullPath (const std::string &Filename)
 
static std::vector< std::string > getBuilderextsDirs ()
 
static std::vector< std::string > getDefaultBuilderextsDirs ()
 
static std::vector< std::string > getExtraBuilderextsDirs ()
 
static void addExtraBuilderextsDirs (const std::string &Paths)
 
static void resetExtraBuilderextsDirs ()
 
static std::string getBuilderextFullPath (const std::string &Filename)
 

Protected Member Functions

 RunContextManager ()
 
 ~RunContextManager ()
 
void updateWaresEnvironment ()
 
- Protected Member Functions inherited from openfluid::base::Environment
 Environment ()
 

Static Protected Member Functions

static std::string getFilePathFromProjectPath (const std::string &ProjectPath)
 
static std::string getInputDirFromProjectPath (const std::string &ProjectPath)
 
static std::string getOuputDirFromProjectPath (const std::string &ProjectPath)
 
static void updateProjectFile (const std::string &ProjectPath)
 
static bool checkProject (const std::string &ProjectPath)
 
- Static Protected Member Functions inherited from openfluid::base::Environment
static std::string getWareFullPath (const std::vector< std::string > &Dirs, const std::string &Filename)
 

Protected Attributes

std::string m_OutputDir
 
std::string m_InputDir
 
bool m_IsClearOutputDir
 
bool m_IsProfiling
 
unsigned int m_ValuesBufferSize
 
unsigned int m_WaresMaxNumThreads
 
openfluid::core::MapValue m_WaresSharedEnvironment
 
openfluid::core::MapValue m_ExtraProperties
 
openfluid::tools::SettingsBackendmp_ProjectFile
 
std::string m_ProjectPath
 
std::string m_ProjectName
 
std::string m_ProjectDescription
 
std::string m_ProjectAuthors
 
std::string m_ProjectCreationDate
 
std::string m_ProjectLastModDate
 
bool m_ProjectIncOutputDir
 
bool m_ProjectIsOpen
 

Static Protected Attributes

static const std::vector< std::string > m_DeprecatedProjectFiles
 
- Static Protected Attributes inherited from openfluid::base::Environment
static std::string m_SystemArch
 
static std::string m_HostName
 
static std::string m_UserName
 
static std::string m_Version
 
static std::string m_VersionFull
 
static std::string m_VersionMajorMinor
 
static std::string m_InstallPrefix
 
static std::string m_TempDir
 
static std::string m_UserHomeDir
 
static std::string m_UserDataDir
 
static std::string m_SettingsFile
 
static std::vector< std::string > m_DefaultSimulatorsDirs
 
static std::vector< std::string > m_ExtraSimulatorsDirs
 
static std::vector< std::string > m_DefaultObserversDirs
 
static std::vector< std::string > m_ExtraObserversDirs
 
static std::vector< std::string > m_DefaultBuilderextsDirs
 
static std::vector< std::string > m_ExtraBuilderextsDirs
 
static std::string m_ProvidedExamplesDir
 
static std::string m_UserExamplesDir
 
static std::string m_UserExampleSimulatorsDir
 
static std::string m_TranslationsDir
 
static std::string m_CommonResourcesDir
 
static std::string m_AppsResourcesDir
 
static int m_IdealThreadCount
 
Inheritance diagram for openfluid::base::RunContextManager:
Collaboration diagram for openfluid::base::RunContextManager:

Constructor & Destructor Documentation

◆ RunContextManager()

openfluid::base::RunContextManager::RunContextManager ( )
protected

◆ ~RunContextManager()

openfluid::base::RunContextManager::~RunContextManager ( )
protected

Member Function Documentation

◆ checkProject()

static bool openfluid::base::RunContextManager::checkProject ( const std::string &  ProjectPath)
staticprotected

◆ closeProject()

void openfluid::base::RunContextManager::closeProject ( )

◆ createProject()

bool openfluid::base::RunContextManager::createProject ( const std::string &  Path,
const std::string &  Name,
const std::string &  Description,
const std::string &  Authors,
const bool  Inc 
)

◆ extraProperties()

openfluid::core::MapValue& openfluid::base::RunContextManager::extraProperties ( )
inline

◆ getFilePathFromProjectPath()

static std::string openfluid::base::RunContextManager::getFilePathFromProjectPath ( const std::string &  ProjectPath)
staticprotected

◆ getInputDir()

std::string openfluid::base::RunContextManager::getInputDir ( ) const
inline

Returns the full path of the simulation input directory

Returns
the full path of the directory

◆ getInputDirFromProjectPath()

static std::string openfluid::base::RunContextManager::getInputDirFromProjectPath ( const std::string &  ProjectPath)
staticprotected

◆ getInputFullPath()

std::string openfluid::base::RunContextManager::getInputFullPath ( const std::string &  Filename) const

Returns the full path of a file or directory relative to the simulation input directory

Parameters
[in]Filenamethe path relative to the simulation input directory
Returns
the full path to the file or directory

◆ getOuputDirFromProjectPath()

static std::string openfluid::base::RunContextManager::getOuputDirFromProjectPath ( const std::string &  ProjectPath)
staticprotected

◆ getOutputDir()

std::string openfluid::base::RunContextManager::getOutputDir ( ) const
inline

Returns the full path of the simulation output directory

Returns
the full path of the directory

◆ getOutputFullPath()

std::string openfluid::base::RunContextManager::getOutputFullPath ( const std::string &  Filename) const

Returns the full path of a file or directory relative to the simulation output directory

Parameters
[in]Filenamethe path relative to the simulation output directory
Returns
the full path to the file or directory

◆ getProjectAuthors()

std::string openfluid::base::RunContextManager::getProjectAuthors ( ) const
inline

◆ getProjectContextValue() [1/2]

openfluid::tools::SettingValue openfluid::base::RunContextManager::getProjectContextValue ( const std::string &  ParentPointer,
const std::string &  Key 
) const

◆ getProjectContextValue() [2/2]

openfluid::tools::SettingValue openfluid::base::RunContextManager::getProjectContextValue ( const std::string &  Pointer) const

◆ getProjectCreationDate()

std::string openfluid::base::RunContextManager::getProjectCreationDate ( ) const
inline

◆ getProjectDescription()

std::string openfluid::base::RunContextManager::getProjectDescription ( ) const
inline

◆ getProjectInfos()

static bool openfluid::base::RunContextManager::getProjectInfos ( const std::string &  Path,
std::string &  Name,
std::string &  Description,
std::string &  Authors,
std::string &  CreationDate,
std::string &  LastModDate 
)
static

◆ getProjectLastModDate()

std::string openfluid::base::RunContextManager::getProjectLastModDate ( ) const
inline

◆ getProjectName()

std::string openfluid::base::RunContextManager::getProjectName ( ) const
inline

◆ getProjectPath()

std::string openfluid::base::RunContextManager::getProjectPath ( ) const
inline

◆ getValuesBufferUserSize()

unsigned int openfluid::base::RunContextManager::getValuesBufferUserSize ( ) const
inline

Returns the size of the buffer set by the user for simulation variables values

Returns
the size of the buffer

◆ getWaresEnvironment()

const openfluid::core::MapValue& openfluid::base::RunContextManager::getWaresEnvironment ( ) const
inline

◆ getWaresMaxNumThreads()

unsigned int openfluid::base::RunContextManager::getWaresMaxNumThreads ( ) const
inline

Returns the value for maximum threads count to be used in OpenFLUID wares (simulators, observers, ...)

Returns
the maximum threads count

◆ isClearOutputDir()

bool openfluid::base::RunContextManager::isClearOutputDir ( ) const
inline

Returns the status of automatic cleaning of output directory before simulation run

Returns
true if enabled, false if disabled

◆ isProfiling()

bool openfluid::base::RunContextManager::isProfiling ( ) const
inline

Returns the status of simulation profiling

Returns
true if enabled, false if disabled

◆ isProject()

static bool openfluid::base::RunContextManager::isProject ( const std::string &  Path)
static

◆ isProjectIncrementalOutputDir()

bool openfluid::base::RunContextManager::isProjectIncrementalOutputDir ( ) const
inline

◆ isProjectOpen()

bool openfluid::base::RunContextManager::isProjectOpen ( ) const
inline

◆ isValuesBufferUserSize()

bool openfluid::base::RunContextManager::isValuesBufferUserSize ( ) const
inline

Returns true if the size of the buffer for simulation variables values has been set by the user

Returns
true if set by user (size > 0), false otherwise

◆ openProject()

bool openfluid::base::RunContextManager::openProject ( const std::string &  Path)

◆ processWareParams()

void openfluid::base::RunContextManager::processWareParams ( openfluid::ware::WareParams_t Params) const

◆ projectContainsDeprecatedFile()

static bool openfluid::base::RunContextManager::projectContainsDeprecatedFile ( const std::string &  Path)
static

◆ removeProjectContextValue()

void openfluid::base::RunContextManager::removeProjectContextValue ( const std::string &  Pointer)

◆ resetWaresMaxNumThreads()

void openfluid::base::RunContextManager::resetWaresMaxNumThreads ( )

Resets the value for maximum threads count to be used in OpenFLUID wares (simulators, observers, ...). The value is reset to the ideal thread count given by the OpenFLUID environment

◆ saveProject()

bool openfluid::base::RunContextManager::saveProject ( )

◆ setClearOutputDir()

void openfluid::base::RunContextManager::setClearOutputDir ( bool  Enabled)
inline

Sets the status of automatic cleaning of output directory before simulation run

Parameters
Enabledset to true to enable

◆ setDateTimeOutputDir()

void openfluid::base::RunContextManager::setDateTimeOutputDir ( )

◆ setInputDir()

void openfluid::base::RunContextManager::setInputDir ( const std::string &  InputDir)

Sets the full path of the simulation input directory

Parameters
[in]InputDirthe full path of the directory

◆ setOutputDir()

void openfluid::base::RunContextManager::setOutputDir ( const std::string &  OutputDir)

Sets the full path of the simulation output directory

Parameters
[in]OutputDirthe full path of the directory

◆ setProfiling()

void openfluid::base::RunContextManager::setProfiling ( bool  Enabled)
inline

Sets the status of simulation profiling

Parameters
Enabledset to true to enable

◆ setProjectAuthors()

void openfluid::base::RunContextManager::setProjectAuthors ( const std::string &  Authors)
inline

◆ setProjectContextValue()

void openfluid::base::RunContextManager::setProjectContextValue ( const std::string &  ParentPointer,
const std::string &  Key,
const openfluid::tools::SettingValue Value 
)

◆ setProjectCreationDate()

void openfluid::base::RunContextManager::setProjectCreationDate ( const std::string &  CreationDate)
inline

◆ setProjectCreationDateAsNow()

void openfluid::base::RunContextManager::setProjectCreationDateAsNow ( )
inline

◆ setProjectDescription()

void openfluid::base::RunContextManager::setProjectDescription ( const std::string &  Description)
inline

◆ setProjectIncrementalOutputDir()

void openfluid::base::RunContextManager::setProjectIncrementalOutputDir ( const bool  Inc)
inline

◆ setProjectLastModDate()

void openfluid::base::RunContextManager::setProjectLastModDate ( const std::string &  LastModDate)
inline

◆ setProjectName()

void openfluid::base::RunContextManager::setProjectName ( const std::string &  Name)
inline

◆ setValuesBufferUserSize()

void openfluid::base::RunContextManager::setValuesBufferUserSize ( unsigned int  Size)
inline

Sets the size of the buffer set by the user for simulation variables values

Parameters
[in]Sizethe size of the buffer

◆ setWaresMaxNumThreads()

void openfluid::base::RunContextManager::setWaresMaxNumThreads ( unsigned int  Num)
inline

Sets the value for maximum threads count to be used in OpenFLUID wares (simulators, observers, ...)

Parameters
[in]Numthe maximum threads count

◆ unsetValuesBufferUserSize()

void openfluid::base::RunContextManager::unsetValuesBufferUserSize ( )
inline

Unsets the size of the buffer set by the user for simulation variables values

◆ updateProjectFile()

static void openfluid::base::RunContextManager::updateProjectFile ( const std::string &  ProjectPath)
staticprotected

◆ updateProjectOutputDir()

void openfluid::base::RunContextManager::updateProjectOutputDir ( )

◆ updateWaresEnvironment()

void openfluid::base::RunContextManager::updateWaresEnvironment ( )
protected

Member Data Documentation

◆ m_DeprecatedProjectFiles

const std::vector<std::string> openfluid::base::RunContextManager::m_DeprecatedProjectFiles
staticprotected

◆ m_ExtraProperties

openfluid::core::MapValue openfluid::base::RunContextManager::m_ExtraProperties
protected

◆ m_InputDir

std::string openfluid::base::RunContextManager::m_InputDir
protected

◆ m_IsClearOutputDir

bool openfluid::base::RunContextManager::m_IsClearOutputDir
protected

◆ m_IsProfiling

bool openfluid::base::RunContextManager::m_IsProfiling
protected

◆ m_OutputDir

std::string openfluid::base::RunContextManager::m_OutputDir
protected

◆ m_ProjectAuthors

std::string openfluid::base::RunContextManager::m_ProjectAuthors
protected

◆ m_ProjectCreationDate

std::string openfluid::base::RunContextManager::m_ProjectCreationDate
protected

◆ m_ProjectDescription

std::string openfluid::base::RunContextManager::m_ProjectDescription
protected

◆ m_ProjectIncOutputDir

bool openfluid::base::RunContextManager::m_ProjectIncOutputDir
protected

◆ m_ProjectIsOpen

bool openfluid::base::RunContextManager::m_ProjectIsOpen
protected

◆ m_ProjectLastModDate

std::string openfluid::base::RunContextManager::m_ProjectLastModDate
protected

◆ m_ProjectName

std::string openfluid::base::RunContextManager::m_ProjectName
protected

◆ m_ProjectPath

std::string openfluid::base::RunContextManager::m_ProjectPath
protected

◆ m_ValuesBufferSize

unsigned int openfluid::base::RunContextManager::m_ValuesBufferSize
protected

◆ m_WaresMaxNumThreads

unsigned int openfluid::base::RunContextManager::m_WaresMaxNumThreads
protected

◆ m_WaresSharedEnvironment

openfluid::core::MapValue openfluid::base::RunContextManager::m_WaresSharedEnvironment
protected

◆ mp_ProjectFile

openfluid::tools::SettingsBackend* openfluid::base::RunContextManager::mp_ProjectFile
protected

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