FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
Core::FMTlist< T > Class Template Reference

#include <FMTlist.hpp>

Inheritance diagram for Core::FMTlist< T >:
[legend]
Collaboration diagram for Core::FMTlist< T >:
[legend]

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)
 
FMTlistoperator= (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)
 
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)
 

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.
 

Detailed Description

template<typename T>
class Core::FMTlist< T >

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.

Member Typedef Documentation

◆ const_iterator

template<typename T >
typedef std::vector<std::pair<FMTmask,T>>::const_iterator Core::FMTlist< T >::const_iterator

Const_Iterator typedef of the FMTlist.

◆ iterator

template<typename T >
typedef std::vector<std::pair<FMTmask,T>>::iterator Core::FMTlist< T >::iterator

Iterator typedef of the FMTlist.

◆ value_type

template<typename T >
typedef std::vector<std::pair<FMTmask,T>>::value_type Core::FMTlist< T >::value_type

Value typedef of the FMTlist.

Constructor & Destructor Documentation

◆ FMTlist() [1/2]

template<typename T >
Core::FMTlist< T >::FMTlist ( )
inline

Default constructor for FMTlist.

◆ FMTlist() [2/2]

template<typename T >
Core::FMTlist< T >::FMTlist ( const FMTlist< T > &  rhs)
inline

Default copy constructor for FMTlist.

◆ ~FMTlist()

template<typename T >
Core::FMTlist< T >::~FMTlist ( )
default

Default destructor for FMTlist.

Member Function Documentation

◆ APIpush_back()

template<typename T >
void Core::FMTlist< T >::APIpush_back ( const FMTmask mask,
const T &  value 
)
inline

For template specification to overcome the static_cast of function

◆ begin() [1/2]

template<typename T >
iterator Core::FMTlist< T >::begin ( )
inline

Returns an iterator at the beginning of the FMTlist.

◆ begin() [2/2]

template<typename T >
const_iterator Core::FMTlist< T >::begin ( ) const
inline

Returns an const iterator at the beginning of the FMTlist.

◆ canshrink()

template<typename T >
bool Core::FMTlist< T >::canshrink ( ) const
inline

Returns true if the FMTlist can be shrink else false.

◆ clearcache()

template<typename T >
virtual void Core::FMTlist< T >::clearcache ( )
inlinevirtual

Clear fastpass by swaping with an empty container.

Reimplemented in Core::FMTyields.

◆ compressmasks() [1/2]

template<typename T >
void Core::FMTlist< T >::compressmasks ( std::vector< FMTtheme > &  newthemes)
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.

◆ compressmasks() [2/2]

void Core::FMTlist< std::unique_ptr< Core::FMTyieldhandler > >::compressmasks ( std::vector< FMTtheme > &  newthemes)
inlineprotected

◆ copydata() [1/2]

template<typename T >
void Core::FMTlist< T >::copydata ( const Core::FMTlist< T > &  rhs)
inlineprotected

◆ copydata() [2/2]

void Core::FMTlist< std::unique_ptr< Core::FMTyieldhandler > >::copydata ( const FMTlist< std::unique_ptr< Core::FMTyieldhandler > > &  rhs)
inlineprotected

◆ empty()

template<typename T >
bool Core::FMTlist< T >::empty ( ) const
inline

Returns true if the FMTlist is empty else false.

◆ end() [1/2]

template<typename T >
iterator Core::FMTlist< T >::end ( )
inline

Returns an iterator at the end of the FMTlist.

◆ end() [2/2]

template<typename T >
const_iterator Core::FMTlist< T >::end ( ) const
inline

Returns an const iterator at the end of the FMTlist.

◆ erase()

template<typename T >
void Core::FMTlist< T >::erase ( const size_t &  location)
inline

Erase a specific element in the FMTlist.

◆ filtermask()

template<typename T >
FMTmask Core::FMTlist< T >::filtermask ( const FMTmask basemask) const
inline

Function used to shrink the FMTmask (basemask) using the global filter of the FMTlist.

◆ findsets()

template<typename T >
std::vector< const T * > Core::FMTlist< T >::findsets ( const FMTmask mask) const
inline

Here is the main function used on FMTlist. Giving a global (mask) it will returns elements that are a subset of the global (mask), in the same order present in the FMTlist. It will also use caching to try to get elements faster next time it's asked by the user.

◆ findsetswithfiltered()

template<typename T >
std::vector< const T * > Core::FMTlist< T >::findsetswithfiltered ( const FMTmask newkey) const
inline

Here is the main function used on FMTlist. Giving a filtered mask (newkey) it will returns elements that are a subset of the global (mask), in the same order present in the FMTlist. It will also use caching to try to get elements faster next time it's asked by the user.

◆ getunion()

template<typename T >
FMTmask Core::FMTlist< T >::getunion ( const std::vector< FMTtheme > &  themes) const
inline

Get a global union mask from all the masks of the FMTlist.

◆ insert() [1/2]

void Core::FMTlist< std::unique_ptr< Core::FMTyieldhandler > >::insert ( const size_t &  location,
const FMTmask mask,
const std::unique_ptr< Core::FMTyieldhandler > &  value 
)
inline

◆ insert() [2/2]

template<typename T >
void Core::FMTlist< T >::insert ( const size_t &  location,
const FMTmask mask,
const T &  value 
)
inline

Insert an element in the FMTlist at a specific location.

◆ operator+=()

template<typename T >
Core::FMTlist< T > & Core::FMTlist< T >::operator+= ( const Core::FMTlist< T > &  OtherList)
inline

append OtherList to this list actions both list had to be non shrinked, will throw exception if shrinked.

Parameters
OtherListthe other list to append to this one.
Returns
A reference the the newly appended list.

◆ operator=()

template<typename T >
FMTlist & Core::FMTlist< T >::operator= ( const FMTlist< T > &  rhs)
inline

Default copy assignment for FMTlist.

◆ operator==()

template<typename T >
bool Core::FMTlist< T >::operator== ( const FMTlist< T > &  rhs) const
inline

Comparison operator of FMTlist.

◆ pop_back()

template<typename T >
void Core::FMTlist< T >::pop_back ( )
inline

Pop back an element at the end of the FMTlist.

◆ presolvelist()

template<typename T >
void Core::FMTlist< T >::presolvelist ( const FMTmaskfilter filter,
const std::vector< FMTtheme > &  originalthemes,
const std::vector< FMTtheme > &  newthemes 
)
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.

◆ push_back() [1/3]

template<typename T >
void Core::FMTlist< T >::push_back ( const FMTlist< T > &  rhs)
inline

Push back a whole FMTlist at the end of this FMTlist.

◆ push_back() [2/3]

void Core::FMTlist< std::unique_ptr< Core::FMTyieldhandler > >::push_back ( const FMTmask mask,
const std::unique_ptr< Core::FMTyieldhandler > &  value 
)
inline

◆ push_back() [3/3]

template<typename T >
void Core::FMTlist< T >::push_back ( const FMTmask mask,
const T &  value 
)
inline

Push back an element at the end of the FMTlist.

◆ push_front()

template<typename T >
void Core::FMTlist< T >::push_front ( const FMTmask mask,
const T &  value 
)
inline

Push front an element at the beginning of the FMTlist.

◆ shrink()

template<typename T >
void Core::FMTlist< T >::shrink ( )
inline

Reduce the size of the FMTmask used in the FMTlist for less complexity.

◆ size()

template<typename T >
size_t Core::FMTlist< T >::size ( ) const
inline

Returns the size of the FMTlist

◆ swap()

template<typename T >
void Core::FMTlist< T >::swap ( Core::FMTlist< T > &  rhs)
inline

Swap function for FMTlist.

◆ unshrink()

template<typename T >
void Core::FMTlist< T >::unshrink ( const std::vector< FMTtheme > &  themes)
inline

Bring back the complexity of each FMTmask into the FMTlist.

◆ update()

template<typename T >
virtual void Core::FMTlist< T >::update ( )
inlinevirtual

Update the FMTlist filter and shrink it if any changes appened in the list.

Reimplemented in Core::FMTaction, Core::FMTlifespans, and Core::FMTyields.

Friends And Related Function Documentation

◆ boost::serialization::access

template<typename T >
friend class boost::serialization::access
friend

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


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