Elements  5.8
A C++ base framework for the Euclid Software.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables

Namespaces

 Path
 
 System
 
 Units
 

Classes

class  Environment
 
class  Exception
 
class  Logging
 Logging API of the Elements framework. More...
 
class  Program
 Abstract class for all Elements programs. More...
 
class  ProgramManager
 Class for managing all Elements programs. More...
 
class  TypeWithSize
 
class  TypeWithSize< 4 >
 
class  TypeWithSize< 8 >
 
class  FloatingPoint
 
class  SimpleProgram
 
class  TempPath
 
class  TempDir
 
class  TempFile
 
class  OptionException
 

Typedefs

using ExitCodeType = std::underlying_type< ExitCode >::type
 Underlying type of the ExitCode class. More...
 
using TempEnv = Environment
 

Enumerations

enum  ExitCode : int {
  ExitCode::OK = 0, ExitCode::NOT_OK = 1, ExitCode::USAGE = 64, ExitCode::DATAERR = 65,
  ExitCode::NOINPUT = 66, ExitCode::NOUSER = 67, ExitCode::NOHOST = 68, ExitCode::UNAVAILABLE = 69,
  ExitCode::SOFTWARE = 70, ExitCode::OSERR = 71, ExitCode::OSFILE = 72, ExitCode::CANTCREAT = 73,
  ExitCode::IOERR = 74, ExitCode::TEMPFAIL = 75, ExitCode::PROTOCOL = 76, ExitCode::NOPERM = 77,
  ExitCode::CONFIG = 78
}
 Strongly typed exit numbers. More...
 
enum  SearchType { SearchType::Local, SearchType::Recursive }
 

Functions

template<typename T >
boost::filesystem::path getAuxiliaryPath (const T &file_name, bool raise_exception)
 
template<typename T >
boost::filesystem::path getConfigurationPath (const T &file_name, bool raise_exception)
 
template<typename T , typename ITER >
std::vector< T > pathSearch (const std::string &searched_name, T directory)
 
template<typename T >
std::vector< T > searchOption (std::string searched_name, T directory, SearchType search_type)
 
template<typename T >
std::vector< T > pathSearch (const std::string &searched_name, T directory, SearchType search_type)
 Searches for a file or a directory in a directory. The search can be recursive (SearchType.Recursive) and in that case more than one results can be return. More...
 
ELEMENTS_API std::string getAuxiliaryVariableName ()
 
template<typename T >
ELEMENTS_API
boost::filesystem::path 
getAuxiliaryPath (const T &file_name, bool raise_exception=true)
 
template ELEMENTS_API
boost::filesystem::path 
getAuxiliaryPath (const boost::filesystem::path &file_name, bool raise_exception)
 
template ELEMENTS_API
boost::filesystem::path 
getAuxiliaryPath (const std::string &file_name, bool raise_exception)
 
ELEMENTS_API std::vector
< boost::filesystem::path > 
getAuxiliaryLocations (bool exist_only=false)
 
ELEMENTS_API std::string getConfigurationVariableName ()
 
template<typename T >
ELEMENTS_API
boost::filesystem::path 
getConfigurationPath (const T &file_name, bool raise_exception=true)
 
template ELEMENTS_API
boost::filesystem::path 
getConfigurationPath (const boost::filesystem::path &file_name, bool raise_exception)
 
template ELEMENTS_API
boost::filesystem::path 
getConfigurationPath (const std::string &file_name, bool raise_exception)
 
ELEMENTS_API std::vector
< boost::filesystem::path > 
getConfigurationLocations (bool exist_only=false)
 
ELEMENTS_API std::ostreamoperator<< (std::ostream &, const Environment::Variable &)
 
ELEMENTS_API Environment::Variable operator+ (const std::string &, const Environment::Variable &)
 
template<typename Ex , typename T , typename = typename std::enable_if<std::is_base_of<Exception, typename std::remove_reference<Ex>::type>::value>::type>
auto operator<< (Ex &&ex, const T &message) -> decltype(std::forward< Ex >(ex))
 
template<typename TargetType , typename SourceType >
ELEMENTS_API TargetType numberCast (const SourceType &s)
 this function is a number cast. It behaves exactly as a static_cast except when casting from a floating point number to an integral one. This one is doing the correct rounding. More...
 
template<typename T >
ELEMENTS_API std::vector< T > pathSearch (const std::string &searched_name, T directory, SearchType search_type)
 Searches for a file or a directory in a directory. The search can be recursive (SearchType.Recursive) and in that case more than one results can be return. More...
 
template ELEMENTS_API
std::vector
< boost::filesystem::path > 
pathSearch (const std::string &searched_name, boost::filesystem::path directory, SearchType search_type)
 
template ELEMENTS_API
std::vector< std::string
pathSearch (const std::string &searched_name, std::string directory, SearchType search_type)
 
ELEMENTS_API std::vector
< boost::filesystem::path > 
pathSearchInEnvVariable (const std::string &file_name, const std::string &path_like_env_variable, SearchType search_type=SearchType::Recursive)
 Searches for a file or a directory in a path pointed by an environment variable. It can contains collection of colon separated locations. The search can be recursive (SearchType.Recursive) and in that case more than one results can be return. More...
 
template<typename RawType >
constexpr std::size_t defaultMaxUlps ()
 
template<>
constexpr std::size_t defaultMaxUlps< float > ()
 
template<>
constexpr std::size_t defaultMaxUlps< double > ()
 
template<typename FloatType >
bool almostEqual2sComplement (ELEMENTS_UNUSED const FloatType &a, ELEMENTS_UNUSED const FloatType &b, ELEMENTS_UNUSED const std::size_t &max_ulps=0)
 
template<typename RawType >
bool isNan (const RawType &x)
 
template<typename RawType , std::size_t max_ulps = defaultMaxUlps<RawType>()>
bool isEqual (const RawType &left, const RawType &right)
 
template<std::size_t max_ulps>
bool isEqual (const float &left, const float &right)
 
template<std::size_t max_ulps>
bool isEqual (const double &left, const double &right)
 
template<typename RawType , std::size_t max_ulps = defaultMaxUlps<RawType>()>
bool isNotEqual (const RawType &left, const RawType &right)
 
template<std::size_t max_ulps>
bool isNotEqual (const float &left, const float &right)
 
template<std::size_t max_ulps>
bool isNotEqual (const double &left, const double &right)
 
template<typename RawType , std::size_t max_ulps = defaultMaxUlps<RawType>()>
bool isLess (const RawType &left, const RawType &right)
 
template<std::size_t max_ulps>
bool isLess (const float &left, const float &right)
 
template<std::size_t max_ulps>
bool isLess (const double &left, const double &right)
 
template<typename RawType , std::size_t max_ulps = defaultMaxUlps<RawType>()>
bool isGreater (const RawType &left, const RawType &right)
 
template<std::size_t max_ulps>
bool isGreater (const float &left, const float &right)
 
template<std::size_t max_ulps>
bool isGreater (const double &left, const double &right)
 
template<typename RawType , std::size_t max_ulps = defaultMaxUlps<RawType>()>
bool isLessOrEqual (const RawType &left, const RawType &right)
 
template<std::size_t max_ulps>
bool isLessOrEqual (const float &left, const float &right)
 
template<std::size_t max_ulps>
bool isLessOrEqual (const double &left, const double &right)
 
template<typename RawType , std::size_t max_ulps = defaultMaxUlps<RawType>()>
bool isGreaterOrEqual (const RawType &left, const RawType &right)
 
template<std::size_t max_ulps>
bool isGreaterOrEqual (const float &left, const float &right)
 
template<std::size_t max_ulps>
bool isGreaterOrEqual (const double &left, const double &right)
 
ELEMENTS_API bool almostEqual2sComplement (const float &left, const float &right, const int &max_ulps=FLT_DEFAULT_MAX_ULPS)
 This function compare 2 floats with a relative tolerance. More...
 
ELEMENTS_API bool almostEqual2sComplement (const double &left, const double &right, const int &max_ulps=DBL_DEFAULT_MAX_ULPS)
 This function compare 2 doubles with a relative tolerance. More...
 
template<typename RawType >
ELEMENTS_API bool realBitWiseEqual (const RawType &left, const RawType &right)
 This function compares 2 floating point numbers bitwise. These are the strict equivalent of the "==". They are only here for the example. More...
 
ELEMENTS_API void normalSleep (int sec)
 Small variation on the sleep function for seconds sleep. More...
 
ELEMENTS_API void nanoSleep (std::int64_t nsec)
 Small variation on the sleep function for nanoseconds sleep. More...
 
ELEMENTS_API std::string getVersionFromSvnKeywords (const std::string &svnUrl, const std::string &svnId)
 Function returning a version string extracted from SVN keywords. More...
 
ELEMENTS_API std::string getVersionString (const unsigned short major, const unsigned short minor, const unsigned short patch=0)
 Function converting the version numbers into a string. More...
 
template path getAuxiliaryPath (const path &file_name, bool raise_exception)
 
template path getConfigurationPath (const path &file_name, bool raise_exception)
 
unique_ptr< Layout > getLogLayout ()
 
template vector< stringpathSearch< string, directory_iterator > (const string &searched_name, string directory)
 
template vector< path > pathSearch< path, directory_iterator > (const string &searched_name, path directory)
 
template vector< stringpathSearch< string, recursive_directory_iterator > (const string &searched_name, string directory)
 
template vector< path > pathSearch< path, recursive_directory_iterator > (const string &searched_name, path directory)
 
template vector< path > pathSearch (const string &searched_name, path directory, SearchType search_type)
 
template bool realBitWiseEqual< float > (const float &left, const float &right)
 
template bool realBitWiseEqual< double > (const double &left, const double &right)
 

Variables

constexpr std::size_t FLT_DEFAULT_MAX_ULPS { 4 }
 Single precision float default maximum unit in the last place. More...
 
constexpr std::size_t DBL_DEFAULT_MAX_ULPS { 10 }
 Double precision float default maximum unit in the last place. More...
 
ELEMENTS_API const double FLT_DEFAULT_TEST_TOLERANCE = pow(10.0, -numeric_limits<float>::digits10)
 Single precision float default test tolerance. More...
 
ELEMENTS_API const double DBL_DEFAULT_TEST_TOLERANCE = pow(10.0, -numeric_limits<double>::digits10)
 Double precision float default test tolerance. More...
 
const std::string DEFAULT_TMP_KEEP_VAR {"KEEPTEMPDIR"}
 The default environment variable name to keep the temporary object. More...
 
const std::string DEFAULT_TMP_MOTIF {"%%%%-%%%%-%%%%-%%%%"}
 The default random creation motif. More...
 
static const std::map< string,
const int > 
LOG_LEVEL
 

Typedef Documentation

Underlying type of the ExitCode class.

Definition at line 122 of file Exit.h.

using Elements::TempEnv = typedef Environment

Definition at line 71 of file Temporary.h.

Enumeration Type Documentation

enum Elements::ExitCode : int
strong

Strongly typed exit numbers.

This has to be used with the MAIN_FOR macro There is no clear universal specification for exit codes. Every system has more or less its convention. Please have a look at http://en.wikipedia.org/wiki/Exit_status. These exit codes do exist for this very documentation. They allow a minimal communication with the batch framework. This gives a clear answer to the caller without the need of parsing the output of the executable. Notes:

  • by default (without any implementation), the uncaught signal produces an exit code of 128+signal value. Please have a look at "man 7 signal". For example the good old SIGSEGV (11) would trigger a system generated exit code of 139 = 128 + 11
  • we can use the exit code range [1,63] to define our own specific codes. Which should be less general that the ones below and reflect the behaviour of our own code.
    • OK : Everything is fine
    • NOT_OK : Something went wrong. This should be the default value for any unspecified failure.
  • the numbers used below are extracted from the header file /usr/include/sysexits.h
    • USAGE : The command was used incorrectly, e.g., with the wrong number of arguments, a bad flag, a bad syntax in a parameter, or whatever.
    • DATAERR : The input data was incorrect in some way. This should only be used for user's data & not system files.
    • NOINPUT : An input file (not a system file) did not exist or was not readable. This could also include errors like "No message" to a mailer (if it cared to catch it).
    • NOUSER : The user specified did not exist. This might be used for mail addresses or remote logins.
    • NOHOST : The host specified did not exist. This is used in mail addresses or network requests.
    • UNAVAILABLE : A service is unavailable. This can occur if a support program or file does not exist. This can also be used as a catchall message when something you wanted to do doesn't work, but you don't know why.
    • SOFTWARE : An internal software error has been detected. This should be limited to non-operating system related errors as possible.
    • OSERR : An operating system error has been detected. This is intended to be used for such things as "cannot fork", "cannot create pipe", or the like. It includes things like getuid returning a user that does not exist in the passwd file.
    • OSFILE : Some system file (e.g., /etc/passwd, /etc/utmp, etc.) does not exist, cannot be opened, or has some sort of error (e.g., syntax error).
    • CANTCREAT : A (user specified) output file cannot be created.
    • IOERR : An error occurred while doing I/O on some file.
    • TEMPFAIL : temporary failure, indicating something that is not really an error. In sendmail, this means that a mailer (e.g.) could not create a connection, and the request should be reattempted later.
    • PROTOCOL : the remote system returned something that was "not possible" during a protocol exchange.
    • NOPERM : You did not have sufficient permission to perform the operation. This is not intended for file system problems, which should use NOINPUT or CANTCREAT, but rather for higher level permissions.
Enumerator
OK 

Everything is OK.

NOT_OK 

Generic unknown failure.

USAGE 

command line usage error

DATAERR 

data format error

NOINPUT 

cannot open input

NOUSER 

addressee unknown

NOHOST 

host name unknown

UNAVAILABLE 

service unavailable

SOFTWARE 

internal software error

OSERR 

system error (e.g., can't fork)

OSFILE 

critical OS file missing

CANTCREAT 

can't create (user) output file

IOERR 

input/output error

TEMPFAIL 

temp failure; user is invited to retry

PROTOCOL 

remote error in protocol

NOPERM 

permission denied

CONFIG 

configuration error

Definition at line 97 of file Exit.h.

enum Elements::SearchType
strong
Enumerator
Local 
Recursive 

Definition at line 37 of file PathSearch.h.

Function Documentation

template<typename FloatType >
bool Elements::almostEqual2sComplement ( ELEMENTS_UNUSED const FloatType &  a,
ELEMENTS_UNUSED const FloatType &  b,
ELEMENTS_UNUSED const std::size_t max_ulps = 0 
)

Definition at line 330 of file Real.h.

bool Elements::almostEqual2sComplement ( const float &  left,
const float &  right,
const int &  max_ulps = FLT_DEFAULT_MAX_ULPS 
)

This function compare 2 floats with a relative tolerance.

The comparison is performed by casting the floating point numbers into integers and then compare their representation with a tolerance for their last bits.

Parameters
leftfirst float number
rightsecond float number
max_ulpsThe relative tolerance is expressed as ULPS (units in the last place). They are unit in the last place of the mantissa. And the recommended default value is 4 for single precision numbers.
Returns
true if the numbers are equal (or cannot be distinguished) and false otherwise.

Definition at line 39 of file Real.cpp.

bool Elements::almostEqual2sComplement ( const double &  left,
const double &  right,
const int &  max_ulps = DBL_DEFAULT_MAX_ULPS 
)

This function compare 2 doubles with a relative tolerance.

The comparison is performed by casting the floating point numbers into integers and then compare their representation with a tolerance for their last bits.

Parameters
leftfirst double number
rightsecond double number
max_ulpsThe relative tolerance is expressed as ULPS (units in the last place). They are unit in the last place of the mantissa. And the recommended default value is 10 for double precision numbers.
Returns
true if the numbers are equal (or cannot be distinguished) and false otherwise.

Definition at line 63 of file Real.cpp.

template<typename RawType >
constexpr std::size_t Elements::defaultMaxUlps ( )

Definition at line 128 of file Real.h.

References FLT_DEFAULT_MAX_ULPS.

template<>
constexpr std::size_t Elements::defaultMaxUlps< double > ( )

Definition at line 138 of file Real.h.

References DBL_DEFAULT_MAX_ULPS.

template<>
constexpr std::size_t Elements::defaultMaxUlps< float > ( )

Definition at line 133 of file Real.h.

References FLT_DEFAULT_MAX_ULPS.

std::vector< path > Elements::getAuxiliaryLocations ( bool  exist_only = false)

Definition at line 50 of file Auxiliary.cpp.

References Elements::Path::auxiliary, Elements::System::DEFAULT_INSTALL_PREFIX, Elements::Path::getLocationsFromEnv(), std::remove_if(), and Elements::Path::VARIABLE.

Referenced by getAuxiliaryPath().

Here is the call graph for this function:

template<typename T >
boost::filesystem::path Elements::getAuxiliaryPath ( const T &  file_name,
bool  raise_exception 
)

Definition at line 33 of file Auxiliary.icpp.

References getAuxiliaryLocations(), and Elements::Path::getPathFromLocations().

Here is the call graph for this function:

template path Elements::getAuxiliaryPath ( const path &  file_name,
bool  raise_exception 
)
template<typename T >
ELEMENTS_API boost::filesystem::path Elements::getAuxiliaryPath ( const T &  file_name,
bool  raise_exception = true 
)

Definition at line 33 of file Auxiliary.icpp.

References getAuxiliaryLocations(), and Elements::Path::getPathFromLocations().

Here is the call graph for this function:

template ELEMENTS_API boost::filesystem::path Elements::getAuxiliaryPath ( const boost::filesystem::path &  file_name,
bool  raise_exception 
)
template path Elements::getAuxiliaryPath ( const std::string file_name,
bool  raise_exception 
)
string Elements::getAuxiliaryVariableName ( )

Definition at line 42 of file Auxiliary.cpp.

References Elements::Path::auxiliary, and Elements::Path::VARIABLE.

std::vector< path > Elements::getConfigurationLocations ( bool  exist_only = false)

Definition at line 51 of file Configuration.cpp.

References Elements::Path::configuration, Elements::System::DEFAULT_INSTALL_PREFIX, Elements::Path::getLocationsFromEnv(), std::remove_if(), and Elements::Path::VARIABLE.

Referenced by getConfigurationPath(), and Elements::ProgramManager::getDefaultConfigFile().

Here is the call graph for this function:

template<typename T >
boost::filesystem::path Elements::getConfigurationPath ( const T &  file_name,
bool  raise_exception 
)

Definition at line 32 of file Configuration.icpp.

References getConfigurationLocations(), and Elements::Path::getPathFromLocations().

Referenced by ElementsServices::DataSync::confFilePath(), and Elements::ProgramManager::getDefaultConfigFile().

Here is the call graph for this function:

template<typename T >
ELEMENTS_API boost::filesystem::path Elements::getConfigurationPath ( const T &  file_name,
bool  raise_exception = true 
)

Definition at line 32 of file Configuration.icpp.

References getConfigurationLocations(), and Elements::Path::getPathFromLocations().

Referenced by ElementsServices::DataSync::confFilePath(), and Elements::ProgramManager::getDefaultConfigFile().

Here is the call graph for this function:

template path Elements::getConfigurationPath ( const path &  file_name,
bool  raise_exception 
)
template ELEMENTS_API boost::filesystem::path Elements::getConfigurationPath ( const boost::filesystem::path &  file_name,
bool  raise_exception 
)
template path Elements::getConfigurationPath ( const std::string file_name,
bool  raise_exception 
)
string Elements::getConfigurationVariableName ( )

Definition at line 43 of file Configuration.cpp.

References Elements::Path::configuration, and Elements::Path::VARIABLE.

unique_ptr<Layout> Elements::getLogLayout ( )

Definition at line 54 of file Logging.cpp.

Referenced by Elements::Logging::getLogger(), and Elements::Logging::setLogFile().

template<typename RawType , std::size_t max_ulps = defaultMaxUlps<RawType>()>
bool Elements::isEqual ( const RawType &  left,
const RawType &  right 
)

Definition at line 351 of file Real.h.

References Elements::FloatingPoint< RawType >::distanceBetweenSignAndMagnitudeNumbers().

Here is the call graph for this function:

template<std::size_t max_ulps>
bool Elements::isEqual ( const float &  left,
const float &  right 
)
inline

Definition at line 366 of file Real.h.

template<std::size_t max_ulps>
bool Elements::isEqual ( const double &  left,
const double &  right 
)
inline

Definition at line 371 of file Real.h.

template<typename RawType , std::size_t max_ulps = defaultMaxUlps<RawType>()>
bool Elements::isGreater ( const RawType &  left,
const RawType &  right 
)

Definition at line 413 of file Real.h.

template<std::size_t max_ulps>
bool Elements::isGreater ( const float &  left,
const float &  right 
)
inline

Definition at line 424 of file Real.h.

template<std::size_t max_ulps>
bool Elements::isGreater ( const double &  left,
const double &  right 
)
inline

Definition at line 429 of file Real.h.

template<typename RawType , std::size_t max_ulps = defaultMaxUlps<RawType>()>
bool Elements::isGreaterOrEqual ( const RawType &  left,
const RawType &  right 
)

Definition at line 455 of file Real.h.

template<std::size_t max_ulps>
bool Elements::isGreaterOrEqual ( const float &  left,
const float &  right 
)
inline

Definition at line 466 of file Real.h.

template<std::size_t max_ulps>
bool Elements::isGreaterOrEqual ( const double &  left,
const double &  right 
)
inline

Definition at line 471 of file Real.h.

template<typename RawType , std::size_t max_ulps = defaultMaxUlps<RawType>()>
bool Elements::isLess ( const RawType &  left,
const RawType &  right 
)

Definition at line 392 of file Real.h.

template<std::size_t max_ulps>
bool Elements::isLess ( const float &  left,
const float &  right 
)
inline

Definition at line 403 of file Real.h.

template<std::size_t max_ulps>
bool Elements::isLess ( const double &  left,
const double &  right 
)
inline

Definition at line 408 of file Real.h.

template<typename RawType , std::size_t max_ulps = defaultMaxUlps<RawType>()>
bool Elements::isLessOrEqual ( const RawType &  left,
const RawType &  right 
)

Definition at line 434 of file Real.h.

template<std::size_t max_ulps>
bool Elements::isLessOrEqual ( const float &  left,
const float &  right 
)
inline

Definition at line 445 of file Real.h.

template<std::size_t max_ulps>
bool Elements::isLessOrEqual ( const double &  left,
const double &  right 
)
inline

Definition at line 450 of file Real.h.

template<typename RawType >
bool Elements::isNan ( const RawType &  x)

Definition at line 338 of file Real.h.

Referenced by Elements::FloatingPoint< RawType >::AlmostEquals().

template<typename RawType , std::size_t max_ulps = defaultMaxUlps<RawType>()>
bool Elements::isNotEqual ( const RawType &  left,
const RawType &  right 
)
inline

Definition at line 376 of file Real.h.

template<std::size_t max_ulps>
bool Elements::isNotEqual ( const float &  left,
const float &  right 
)
inline

Definition at line 381 of file Real.h.

template<std::size_t max_ulps>
bool Elements::isNotEqual ( const double &  left,
const double &  right 
)
inline

Definition at line 386 of file Real.h.

void Elements::nanoSleep ( std::int64_t  nsec)

Small variation on the sleep function for nanoseconds sleep.

Small variation on the sleep function for nanoseconds sleep.

Author
Marco Clemencic
Hubert Degaudenzi

Definition at line 40 of file Sleep.cpp.

void Elements::normalSleep ( int  sec)

Small variation on the sleep function for seconds sleep.

Simple sleep function.

Author
Marco Clemencic
Hubert Degaudenzi

Definition at line 33 of file Sleep.cpp.

template<typename TargetType , typename SourceType >
ELEMENTS_API TargetType Elements::numberCast ( const SourceType &  s)

this function is a number cast. It behaves exactly as a static_cast except when casting from a floating point number to an integral one. This one is doing the correct rounding.

Parameters
snumber to cast
Returns
casted number

Definition at line 47 of file Number.h.

References std::round(), and Elements::Units::s.

Here is the call graph for this function:

Environment::Variable Elements::operator+ ( const std::string value,
const Environment::Variable &  other 
)

Definition at line 336 of file Environment.cpp.

References Elements::Environment::Variable::env(), Elements::Environment::Variable::index(), and Elements::Environment::Variable::prepend().

Here is the call graph for this function:

ostream & Elements::operator<< ( std::ostream stream,
const Environment::Variable &  v 
)

Definition at line 328 of file Environment.cpp.

References Elements::Environment::Variable::value().

Here is the call graph for this function:

template<typename Ex , typename T , typename = typename std::enable_if<std::is_base_of<Exception, typename std::remove_reference<Ex>::type>::value>::type>
auto Elements::operator<< ( Ex &&  ex,
const T &  message 
) -> decltype(std::forward<Ex>(ex))

Definition at line 167 of file Exception.h.

template<typename T , typename ITER >
std::vector<T> Elements::pathSearch ( const std::string searched_name,
directory 
)

Definition at line 36 of file PathSearch.icpp.

Referenced by pathSearchInEnvVariable().

template vector<path> Elements::pathSearch ( const string searched_name,
path  directory,
SearchType  search_type 
)
template<typename T >
ELEMENTS_API std::vector<T> Elements::pathSearch ( const std::string searched_name,
directory,
SearchType  search_type 
)

Searches for a file or a directory in a directory. The search can be recursive (SearchType.Recursive) and in that case more than one results can be return.

Parameters
searched_nameName of the searched file or directory
Template Parameters
Tinput type string or Boost path of the directory in which the search is carried out
Parameters
directoryThe directory where the search is performed.
search_typeTwo options: SearchType.Local search in directory only SearchType.Recursive search in sub-directories too
Returns
A vector of paths of the files found or empty string, if nothing is found

Definition at line 79 of file PathSearch.icpp.

template ELEMENTS_API std::vector<boost::filesystem::path> Elements::pathSearch ( const std::string searched_name,
boost::filesystem::path  directory,
SearchType  search_type 
)
template vector< string > Elements::pathSearch ( const std::string searched_name,
std::string  directory,
SearchType  search_type 
)
template<typename T >
std::vector<T> Elements::pathSearch ( const std::string searched_name,
directory,
SearchType  search_type 
)

Searches for a file or a directory in a directory. The search can be recursive (SearchType.Recursive) and in that case more than one results can be return.

Parameters
searched_nameName of the searched file or directory
Template Parameters
Tinput type string or Boost path of the directory in which the search is carried out
Parameters
directoryThe directory where the search is performed.
search_typeTwo options: SearchType.Local search in directory only SearchType.Recursive search in sub-directories too
Returns
A vector of paths of the files found or empty string, if nothing is found

Definition at line 79 of file PathSearch.icpp.

template vector<path> Elements::pathSearch< path, directory_iterator > ( const string searched_name,
path  directory 
)
template vector<path> Elements::pathSearch< path, recursive_directory_iterator > ( const string searched_name,
path  directory 
)
template vector<string> Elements::pathSearch< string, directory_iterator > ( const string searched_name,
string  directory 
)
template vector<string> Elements::pathSearch< string, recursive_directory_iterator > ( const string searched_name,
string  directory 
)
vector< path > Elements::pathSearchInEnvVariable ( const std::string file_name,
const std::string path_like_env_variable,
SearchType  search_type = SearchType::Recursive 
)

Searches for a file or a directory in a path pointed by an environment variable. It can contains collection of colon separated locations. The search can be recursive (SearchType.Recursive) and in that case more than one results can be return.

Parameters
file_nameName of the searched file or directory
path_like_env_variableThe environment variable name that contains the list of directories
search_typeTwo options: SearchType.Local search in directory only SearchType.Recursive search in sub-directories too
Returns
A vector of paths of the files found or empty string, if nothing is found

Iterate over the different directories included in the path-like environment variable, i.e.,

path1:path2:path3 ...

and call pathSearch(...) for each of them

Definition at line 68 of file PathSearch.cpp.

References std::string::c_str(), Elements::System::getEnv(), and pathSearch().

Here is the call graph for this function:

template<typename RawType >
ELEMENTS_API bool Elements::realBitWiseEqual ( const RawType &  left,
const RawType &  right 
)

This function compares 2 floating point numbers bitwise. These are the strict equivalent of the "==". They are only here for the example.

Parameters
leftright hand number to compare
rightleft hand number to compare
Template Parameters
RawTyperaw type: ie float or double
Returns
true if the 2 numbers are bitwise equal

Definition at line 526 of file Real.h.

template bool Elements::realBitWiseEqual< double > ( const double &  left,
const double &  right 
)
template bool Elements::realBitWiseEqual< float > ( const float &  left,
const float &  right 
)
template<typename T >
std::vector<T> Elements::searchOption ( std::string  searched_name,
directory,
SearchType  search_type 
)

Definition at line 59 of file PathSearch.icpp.

References Local, and Recursive.

Variable Documentation

constexpr std::size_t Elements::DBL_DEFAULT_MAX_ULPS { 10 }

Double precision float default maximum unit in the last place.

Definition at line 89 of file Real.h.

Referenced by defaultMaxUlps< double >().

const double Elements::DBL_DEFAULT_TEST_TOLERANCE = pow(10.0, -numeric_limits<double>::digits10)

Double precision float default test tolerance.

Definition at line 36 of file Real.cpp.

const std::string Elements::DEFAULT_TMP_KEEP_VAR {"KEEPTEMPDIR"}

The default environment variable name to keep the temporary object.

Definition at line 38 of file Temporary.h.

const std::string Elements::DEFAULT_TMP_MOTIF {"%%%%-%%%%-%%%%-%%%%"}

The default random creation motif.

Definition at line 40 of file Temporary.h.

constexpr std::size_t Elements::FLT_DEFAULT_MAX_ULPS { 4 }

Single precision float default maximum unit in the last place.

Definition at line 87 of file Real.h.

Referenced by defaultMaxUlps(), and defaultMaxUlps< float >().

const double Elements::FLT_DEFAULT_TEST_TOLERANCE = pow(10.0, -numeric_limits<float>::digits10)

Single precision float default test tolerance.

Definition at line 35 of file Real.cpp.

const std::map<string, const int> Elements::LOG_LEVEL
static
Initial value:
{{"FATAL", Priority::FATAL},
{"ERROR", Priority::ERROR},
{"WARN", Priority::WARN},
{"INFO", Priority::INFO},
{"DEBUG", Priority::DEBUG}}

Definition at line 48 of file Logging.cpp.

Referenced by Elements::Logging::setLevel().