FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Static Protected Attributes | Friends | List of all members
Core::FMTobject Class Reference

#include <FMTobject.hpp>

Inheritance diagram for Core::FMTobject:
[legend]
Collaboration diagram for Core::FMTobject:
[legend]

Public Member Functions

 FMTobject ()
 
virtual ~FMTobject ()
 
 FMTobject (const std::shared_ptr< Exception::FMTexceptionhandler > exhandler)
 
 FMTobject (const FMTobject &rhs)
 
FMTobjectoperator= (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
 

Detailed Description

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...

Constructor & Destructor Documentation

◆ FMTobject() [1/3]

Core::FMTobject::FMTobject ( )

FMTobject default constructor.

◆ ~FMTobject()

virtual Core::FMTobject::~FMTobject ( )
virtual

FMTobject default virutal destructor.

◆ FMTobject() [2/3]

Core::FMTobject::FMTobject ( const std::shared_ptr< Exception::FMTexceptionhandler exhandler)

When constructing a new FMTobject it's sometime usefull to passin the exception handler of an other FMTobject.

◆ FMTobject() [3/3]

Core::FMTobject::FMTobject ( const FMTobject rhs)

FMTobject default copy constructor.

Member Function Documentation

◆ checksignals()

void Core::FMTobject::checksignals ( ) const
protected

This function only check if the user has sent a ctrl-c signal using boost::python to FMT.

◆ disablenestedexceptions()

void Core::FMTobject::disablenestedexceptions ( )

Disable nested exception throw of the Exceptionhandler by default all handlers do nested exception throw.

◆ enablenestedexceptions()

void Core::FMTobject::enablenestedexceptions ( )

Enable nested exception throw of the Exceptionhandler by default all handlers do nested exception throw.

◆ forceload()

template<class Archive >
void Core::FMTobject::forceload ( Archive &  ar,
const unsigned int  version 
)
inlineprotected

By Default the serialization of a FMTobject does nothing if you want to get some usefull information use this function.

◆ forcesave()

template<class Archive >
void Core::FMTobject::forcesave ( Archive &  ar,
const unsigned int  version 
) const
inlineprotected

By Default the serialization of a FMTobject does nothing if you want to get some usefull information use this function.

◆ getavailablememory()

static unsigned long long Core::FMTobject::getavailablememory ( )
static

Get the available memory in bytes

◆ getclock()

static std::chrono::time_point< std::chrono::high_resolution_clock > Core::FMTobject::getclock ( )
staticprotected

Will return a clock of "now" time.

◆ getduration()

template<class chrono >
static double Core::FMTobject::getduration ( const std::chrono::time_point< std::chrono::high_resolution_clock > &  startclock)
staticprotected

With the high resolution clock you can get the time it took has a double.

◆ getdurationinseconds()

static std::string Core::FMTobject::getdurationinseconds ( const std::chrono::time_point< std::chrono::high_resolution_clock > &  startclock)
staticprotected

With the clock time calculate time spent in second and return a string.

◆ getruntimelocation()

static std::string Core::FMTobject::getruntimelocation ( )
static

This function return the location of the FMT shared library location.

◆ operator=()

FMTobject & Core::FMTobject::operator= ( const FMTobject rhs)

FMTobject default copy assignment.

◆ passinexceptionhandler()

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.

◆ passinlogger()

virtual void Core::FMTobject::passinlogger ( const std::shared_ptr< Logging::FMTlogger > &  logger)
virtual

◆ redirectlogtofile()

void Core::FMTobject::redirectlogtofile ( const std::string &  location)

redict the log to a specific file (will append to it)

◆ setCPLhandler()

void Core::FMTobject::setCPLhandler ( )
protected

This function is for gdal only it pass the FMT exception handler to gdal exception handler.

◆ setdebugexceptionhandler()

void Core::FMTobject::setdebugexceptionhandler ( )

Create and set a debug exception handler to the FMTobject.

◆ setdebuglogger()

virtual void Core::FMTobject::setdebuglogger ( )
virtual

Create and set a debug logger to the FMTobject.

◆ setdefaultexceptionhandler()

void Core::FMTobject::setdefaultexceptionhandler ( )

Create and set a default exception handler to the FMTobject.

◆ setdefaultlogger()

virtual void Core::FMTobject::setdefaultlogger ( )
virtual

Create and set a default logger to the FMTobject.

◆ seterrorstowarnings()

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...

◆ setfreeexceptionhandler()

void Core::FMTobject::setfreeexceptionhandler ( )

Create and set a free exception handler to the FMTobject.

◆ setmaxwarningsbeforesilenced()

void Core::FMTobject::setmaxwarningsbeforesilenced ( const size_t &  maxwarningcount)

Change the number of warning raise before silenced.

◆ setquietexceptionhandler()

void Core::FMTobject::setquietexceptionhandler ( )

Create and set a quiet exception handler to the FMTobject.

◆ setquietlogger()

virtual void Core::FMTobject::setquietlogger ( )
virtual

Create and set a quiet logger to the FMTobject.

◆ settasklogger()

virtual void Core::FMTobject::settasklogger ( )
virtual

Create and set a quiet logger to the FMTobject.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Serialize function is for serialization, used to do multiprocessing across multiple cpus (pickle in Pyhton)

Member Data Documentation

◆ _exhandler

std::shared_ptr<Exception::FMTexceptionhandler> Core::FMTobject::_exhandler
staticprotected

A shared pointer to the exception handler.

◆ _logger

std::shared_ptr<Logging::FMTlogger> Core::FMTobject::_logger
staticprotected

A shared pointer to the logger.


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