FMT 0.9.8
Forest management tools for forest planning
|
#include <FMTlist.hpp>
Public Types | |
typedef std::vector< std::pair< FMTmask, T > >::value_type | value_type |
Value typedef of the FMTlist. | |
typedef std::vector< std::pair< FMTmask, T > >::iterator | iterator |
Iterator typedef of the FMTlist. | |
typedef std::vector< std::pair< FMTmask, T > >::const_iterator | const_iterator |
Const_Iterator typedef of the FMTlist. | |
Public Member Functions | |
Core::FMTlist< T > & | operator+= (const Core::FMTlist< T > &OtherList) |
append OtherList to this list actions both list had to be non shrinked, will throw exception if shrinked. | |
void | swap (Core::FMTlist< T > &rhs) |
FMTmask | getunion (const std::vector< FMTtheme > &themes) const |
FMTlist () | |
FMTlist (const FMTlist< T > &rhs) | |
FMTlist & | operator= (const FMTlist< T > &rhs) |
bool | operator== (const FMTlist< T > &rhs) const |
~FMTlist ()=default | |
bool | empty () const |
bool | canshrink () const |
virtual void | clearcache () |
size_t | size () const |
std::vector< const T * > | findsets (const FMTmask &mask) const |
std::vector< const T * > | findsetswithfiltered (const FMTmask &newkey) const |
FMTmask | filtermask (const FMTmask &basemask) const |
void | shrink () |
void | unshrink (const std::vector< FMTtheme > &themes) |
void | APIpush_back (const FMTmask &mask, const T &value) |
void | push_back (const FMTmask &mask, const T &value) |
virtual void | update () |
void | push_back (const FMTlist< T > &rhs) |
void | push_front (const FMTmask &mask, const T &value) |
void | pop_back () |
void | erase (const size_t &location) |
void | insert (const size_t &location, const FMTmask &mask, const T &value) |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
void | insert (const size_t &location, const FMTmask &mask, const std::unique_ptr< Core::FMTyieldhandler > &value) |
void | push_back (const FMTmask &mask, const std::unique_ptr< Core::FMTyieldhandler > &value) |
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) |
Protected Member Functions | |
void | compressmasks (std::vector< FMTtheme > &newthemes) |
void | presolvelist (const FMTmaskfilter &filter, const std::vector< FMTtheme > &originalthemes, const std::vector< FMTtheme > &newthemes) |
void | copydata (const Core::FMTlist< T > &rhs) |
void | compressmasks (std::vector< FMTtheme > &newthemes) |
void | copydata (const FMTlist< std::unique_ptr< Core::FMTyieldhandler > > &rhs) |
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 () |
Friends | |
class | boost::serialization::access |
Additional Inherited Members | |
Static Public Member Functions inherited from Core::FMTobject | |
static std::string | getruntimelocation () |
static unsigned long long | getavailablememory () |
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. | |
The FMTlist class is made to keep track of objects with a FMTmask tag like dictionary. The yield, action and transition class uses this class to list objects based on the tagged FMTmask and the position of the object in the list. FMTlist uses caching and a mask filter to reduce the size of the list and gives a fast access to objects present in the list.
typedef std::vector<std::pair<FMTmask,T>>::const_iterator Core::FMTlist< T >::const_iterator |
Const_Iterator typedef of the FMTlist.
typedef std::vector<std::pair<FMTmask,T>>::iterator Core::FMTlist< T >::iterator |
Iterator typedef of the FMTlist.
typedef std::vector<std::pair<FMTmask,T>>::value_type Core::FMTlist< T >::value_type |
Value typedef of the FMTlist.
|
inline |
Default constructor for FMTlist.
|
inline |
Default copy constructor for FMTlist.
|
default |
Default destructor for FMTlist.
|
inline |
For template specification to overcome the static_cast of function
|
inline |
Returns an iterator at the beginning of the FMTlist.
|
inline |
Returns an const iterator at the beginning of the FMTlist.
|
inline |
Returns true if the FMTlist can be shrink else false.
|
inlinevirtual |
Clear fastpass by swaping with an empty container.
Reimplemented in Core::FMTyields.
|
inlineprotected |
During pressolve you can compress multiple mask into single one if you have the same data. Usefull for actions and transitions. It will compress mask by generating aggregates and so make changes to themes.
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inline |
Returns true if the FMTlist is empty else false.
|
inline |
Returns an iterator at the end of the FMTlist.
|
inline |
Returns an const iterator at the end of the FMTlist.
|
inline |
Erase a specific element in the FMTlist.
|
inline |
|
inline |
|
inline |
|
inline |
Get a global union mask from all the masks of the FMTlist.
|
inline |
|
inline |
Insert an element in the FMTlist at a specific location.
|
inline |
append OtherList to this list actions both list had to be non shrinked, will throw exception if shrinked.
OtherList | the other list to append to this one. |
|
inline |
Default copy assignment for FMTlist.
|
inline |
Comparison operator of FMTlist.
|
inline |
Pop back an element at the end of the FMTlist.
|
inlineprotected |
Using a basemask reprensenting the whole forest landscape this function will attempt to reduce the number of elements in the list knowing that if the element represent something that is not in the basemask this element could be deleted. Also using a presolvecmask representing Use this function with care because it's going to change the stade of the list if user attempt to reference to a deleted element the model will seems broken.
|
inline |
|
inline |
|
inline |
Push back an element at the end of the FMTlist.
|
inline |
Push front an element at the beginning of the FMTlist.
|
inline |
|
inline |
Returns the size of the FMTlist
|
inline |
Swap function for FMTlist.
|
inline |
|
inlinevirtual |
Update the FMTlist filter and shrink it if any changes appened in the list.
Reimplemented in Core::FMTaction, Core::FMTlifespans, and Core::FMTyields.
|
friend |
Save function is for serialization, used to do multiprocessing across multiple cpus (pickle in Pyhton)