FMT 0.9.8
Forest management tools for forest planning
|
#include <FMTtheme.hpp>
Public Member Functions | |
FMTtheme ()=default | |
~FMTtheme ()=default | |
FMTtheme (const std::vector< std::string > &lattributes, const std::vector< std::string > &lattributenames, const std::vector< std::string > &laggregates, const std::vector< std::vector< std::string > > &laggregatenames, const std::vector< std::map< std::string, double > > &lindexes, const size_t &lid, const size_t &lstart, const std::string &lname) | |
FMTtheme (const std::vector< std::string > &lattributes, const std::vector< std::string > &lattributenames, const std::vector< std::string > &laggregates, const std::vector< std::vector< std::string > > &laggregatenames, const size_t &lid, const size_t &lstart, const std::string &lname) | |
FMTtheme (const std::vector< std::string > &lattributes, const size_t &lid, const size_t &lstart, const std::string &lname) | |
FMTtheme (const FMTtheme &rhs) | |
FMTtheme & | operator= (const FMTtheme &rhs) |
bool | isattribute (const std::string &value) const |
bool | isaggregate (const std::string &value) const |
bool | isindex (const std::string &attribute, const std::string &value) const |
bool | isindex (const std::string &value) const |
bool | useindex () const |
double | getindex (const std::string &attribute, const std::string &value) const |
bool | inaggregate (const std::string &value, const std::string &aggregate) |
bool | isvalid (const std::string &value) const |
bool | operator== (const FMTtheme &rhs) const |
size_t | size () const |
const size_t & | getstart () const |
const size_t & | getid () const |
std::string | getname () const |
bool | empty () const |
std::vector< std::string > | getattributes (const std::string &value, bool aggregate_source=false) const |
const std::vector< std::string > & | getbaseattributes () const |
const std::vector< std::string > & | getattributenames () const |
FMTtheme | presolve (FMTmaskfilter &maskfilter, size_t &newid, size_t &newstart) const |
std::string | updatefrommask (const Core::FMTmask &globalmask) |
operator std::string () const | |
std::vector< std::string > | getaggregates () const |
Public Member Functions inherited from Core::FMTobject | |
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 bool | validate (const std::vector< Core::FMTtheme > &themes, std::string &mask, std::string otherinformation=std::string()) |
static bool | checkmask (const std::vector< Core::FMTtheme > &themes, const std::vector< std::string > &values, std::string &mask, const std::string &otherinformation) |
Static Public Member Functions inherited from Core::FMTobject | |
static std::string | getruntimelocation () |
static unsigned long long | getavailablememory () |
Protected Attributes | |
size_t | id |
Id is the id of the theme first theme in the landscape section is number 1. | |
size_t | start |
Start is the bit location in the FMTmask at which the attributes of the theme starts. | |
Friends | |
class | FMTmask |
class | Parser::FMTlandscapeparser |
class | boost::serialization::access |
Additional Inherited Members | |
Protected Member Functions inherited from Core::FMTobject | |
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 inherited from Core::FMTobject | |
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 inherited from Core::FMTobject | |
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. | |
FMTtheme hold multiple attributes for only one theme. FMTtheme gives the description of a part of a FMTmask from the start bit to the start + theme.size() bit. It also hold the information about attribute aggregates. FMTtheme is realy close to FMTmask class.
|
default |
Default constructor for FMTtheme.
|
default |
Default destructor for FMTtheme.
Core::FMTtheme::FMTtheme | ( | const std::vector< std::string > & | lattributes, |
const std::vector< std::string > & | lattributenames, | ||
const std::vector< std::string > & | laggregates, | ||
const std::vector< std::vector< std::string > > & | laggregatenames, | ||
const std::vector< std::map< std::string, double > > & | lindexes, | ||
const size_t & | lid, | ||
const size_t & | lstart, | ||
const std::string & | lname | ||
) |
Core::FMTtheme::FMTtheme | ( | const std::vector< std::string > & | lattributes, |
const std::vector< std::string > & | lattributenames, | ||
const std::vector< std::string > & | laggregates, | ||
const std::vector< std::vector< std::string > > & | laggregatenames, | ||
const size_t & | lid, | ||
const size_t & | lstart, | ||
const std::string & | lname | ||
) |
Core::FMTtheme::FMTtheme | ( | const std::vector< std::string > & | lattributes, |
const size_t & | lid, | ||
const size_t & | lstart, | ||
const std::string & | lname | ||
) |
A more simple constructor for FMTtheme without aggregates and indexing.
|
static |
This function validate the mask string for a given vector of themes and throw exception if something is not right. It'S called by the validate function.
|
inline |
Check if the FMTtheme is empty (no attribute).
std::vector< std::string > Core::FMTtheme::getaggregates | ( | ) | const |
Returns the aggregates of the theme.
|
inline |
Get the names of the attributes.
std::vector< std::string > Core::FMTtheme::getattributes | ( | const std::string & | value, |
bool | aggregate_source = false |
||
) | const |
Get the attributes of a aggregate (value) for the FMTtheme if aggregate_source == true then the aggregate source map is used.
|
inline |
Get a reference to the base attributes of the theme.
|
inline |
Getter for the FMTtheme id.
double Core::FMTtheme::getindex | ( | const std::string & | attribute, |
const std::string & | value | ||
) | const |
Get the index for the given (attribute) of the index (value).
|
inline |
Getter for the FMTtheme name.
|
inline |
Return the bit location of the mask at which the theme starts.
bool Core::FMTtheme::inaggregate | ( | const std::string & | value, |
const std::string & | aggregate | ||
) |
Check if the (value) is part of the (aggregate).
|
inline |
Return true if the (value) is an aggregate of the FMTtheme.
|
inline |
Return true if the (value) is an attribute of the FMTtheme.
bool Core::FMTtheme::isindex | ( | const std::string & | attribute, |
const std::string & | value | ||
) | const |
Return true if the (value) is an index of the FMTtheme (only use in yields section).
bool Core::FMTtheme::isindex | ( | const std::string & | value | ) | const |
Return true if the (value) is an index of the FMTtheme (only use in yields section).
bool Core::FMTtheme::isvalid | ( | const std::string & | value | ) | const |
Check if the (value) is a valid attribute | aggregate | ? for the FMTtheme.
Core::FMTtheme::operator std::string | ( | ) | const |
Return a string representation of the FMTtheme seen in a landscape file
FMTtheme Core::FMTtheme::presolve | ( | FMTmaskfilter & | maskfilter, |
size_t & | newid, | ||
size_t & | newstart | ||
) | const |
|
inline |
Return the size of FMTtheme can be 0 if the theme has no attribute.
std::string Core::FMTtheme::updatefrommask | ( | const Core::FMTmask & | globalmask | ) |
Base on a global mask it will update the theme with the aggregate in the mask or with newly created aggregates. It will also return the new attribute value.
bool Core::FMTtheme::useindex | ( | ) | const |
Return true if the FMTtheme uses index.
|
static |
The funciton validate a the construction of a valid FMTmask using the mask string based on the themes. If their's less themes that the number present in the string mask then the string mask is going to be trim for the good number of FMTthemes.
|
friend |
Serialize function is for serialization, used to do multiprocessing across multiple cpus (pickle in Pyhton)
|
friend |
|
friend |
|
protected |
Id is the id of the theme first theme in the landscape section is number 1.
|
protected |
Start is the bit location in the FMTmask at which the attributes of the theme starts.