FMT 0.9.8
Forest management tools for forest planning
|
#include <FMTobject.hpp>
Public Member Functions | |
FMTobject () | |
virtual | ~FMTobject () |
FMTobject (const std::shared_ptr< Exception::FMTexceptionhandler > exhandler) | |
FMTobject (const FMTobject &rhs) | |
FMTobject & | operator= (const FMTobject &rhs) |
virtual void | passinlogger (const std::shared_ptr< Logging::FMTlogger > &logger) |
void | passinexceptionhandler (const std::shared_ptr< Exception::FMTexceptionhandler > &exhandler) |
void | redirectlogtofile (const std::string &location) |
virtual void | setdefaultlogger () |
virtual void | setquietlogger () |
virtual void | settasklogger () |
virtual void | setdebuglogger () |
void | setdefaultexceptionhandler () |
void | setquietexceptionhandler () |
void | setdebugexceptionhandler () |
void | setfreeexceptionhandler () |
void | disablenestedexceptions () |
void | enablenestedexceptions () |
void | seterrorstowarnings (const std::vector< Exception::FMTexc > &errors) |
void | setmaxwarningsbeforesilenced (const size_t &maxwarningcount) |
Static Public Member Functions | |
static std::string | getruntimelocation () |
static unsigned long long | getavailablememory () |
Protected Member Functions | |
template<class Archive > | |
void | forcesave (Archive &ar, const unsigned int version) const |
template<class Archive > | |
void | forceload (Archive &ar, const unsigned int version) |
void | checksignals () const |
void | setCPLhandler () |
Static Protected Member Functions | |
static std::chrono::time_point< std::chrono::high_resolution_clock > | getclock () |
template<class chrono > | |
static double | getduration (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock) |
static std::string | getdurationinseconds (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock) |
Static Protected Attributes | |
static std::shared_ptr< Exception::FMTexceptionhandler > | _exhandler |
A shared pointer to the exception handler. | |
static std::shared_ptr< Logging::FMTlogger > | _logger |
A shared pointer to the logger. | |
Friends | |
class | boost::serialization::access |
FMTobject is the base class of multiple class it hold a shared exception handler pointer and logger. FMTobject plays a big role into exception handling and for ctrl-c signals for boost python. It also contains some usefull functions for mask validation and runtimelocation etc...
Core::FMTobject::FMTobject | ( | ) |
FMTobject default constructor.
|
virtual |
FMTobject default virutal destructor.
Core::FMTobject::FMTobject | ( | const std::shared_ptr< Exception::FMTexceptionhandler > | exhandler | ) |
|
protected |
This function only check if the user has sent a ctrl-c signal using boost::python to FMT.
void Core::FMTobject::disablenestedexceptions | ( | ) |
Disable nested exception throw of the Exceptionhandler by default all handlers do nested exception throw.
void Core::FMTobject::enablenestedexceptions | ( | ) |
Enable nested exception throw of the Exceptionhandler by default all handlers do nested exception throw.
|
inlineprotected |
By Default the serialization of a FMTobject does nothing if you want to get some usefull information use this function.
|
inlineprotected |
By Default the serialization of a FMTobject does nothing if you want to get some usefull information use this function.
|
static |
Get the available memory in bytes
|
staticprotected |
Will return a clock of "now" time.
|
staticprotected |
With the high resolution clock you can get the time it took has a double.
|
staticprotected |
With the clock time calculate time spent in second and return a string.
|
static |
This function return the location of the FMT shared library location.
void Core::FMTobject::passinexceptionhandler | ( | const std::shared_ptr< Exception::FMTexceptionhandler > & | exhandler | ) |
It's sometime usefull to pass in the exception handler of an other FMTobject.
|
virtual |
It's sometime usefull to pass in the logger of an other FMTobject.
Reimplemented in Models::FMTlpsolver, Parallel::FMTopareaschedulertask, Parallel::FMTplanningtask, Parallel::FMTreplanningtask, Models::FMTsrmodel, and Parallel::FMTtaskhandler.
void Core::FMTobject::redirectlogtofile | ( | const std::string & | location | ) |
redict the log to a specific file (will append to it)
|
protected |
This function is for gdal only it pass the FMT exception handler to gdal exception handler.
void Core::FMTobject::setdebugexceptionhandler | ( | ) |
Create and set a debug exception handler to the FMTobject.
|
virtual |
Create and set a debug logger to the FMTobject.
void Core::FMTobject::setdefaultexceptionhandler | ( | ) |
Create and set a default exception handler to the FMTobject.
|
virtual |
Create and set a default logger to the FMTobject.
void Core::FMTobject::seterrorstowarnings | ( | const std::vector< Exception::FMTexc > & | errors | ) |
Very hazardous function if you want to live dangerously you can set a vector of error to be cast to warnings to the exception handler...
void Core::FMTobject::setfreeexceptionhandler | ( | ) |
Create and set a free exception handler to the FMTobject.
void Core::FMTobject::setmaxwarningsbeforesilenced | ( | const size_t & | maxwarningcount | ) |
Change the number of warning raise before silenced.
void Core::FMTobject::setquietexceptionhandler | ( | ) |
Create and set a quiet exception handler to the FMTobject.
|
virtual |
Create and set a quiet logger to the FMTobject.
|
virtual |
Create and set a quiet logger to the FMTobject.
|
friend |
Serialize function is for serialization, used to do multiprocessing across multiple cpus (pickle in Pyhton)
|
staticprotected |
A shared pointer to the exception handler.
|
staticprotected |
A shared pointer to the logger.