FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
Graph::FMTOutputNodeCache< tvdescriptor, titerator > Class Template Reference

Cache of graph vertices for output nodes, keyed by output source, used to speed up output computation on the graph. More...

#include <FMTOutputNodeCache.h>

Public Member Functions

 FMTOutputNodeCache ()=default
 Default constructor for FMTOutputNodeCache.
 
 FMTOutputNodeCache (const FMTOutputNodeCache &rhs)=default
 Copy constructor for FMTOutputNodeCache.
 
FMTOutputNodeCacheoperator= (const FMTOutputNodeCache &rhs)=default
 Copy assignment operator for FMTOutputNodeCache.
 
 ~FMTOutputNodeCache ()=default
 Default destructor for FMTOutputNodeCache.
 
 FMTOutputNodeCache (const std::vector< tvdescriptor > &initialnodes)
 Construct a cache from an initial set of nodes.
 
 FMTOutputNodeCache (const titerator &first, const titerator &last, std::allocator< tvdescriptor > &p_allocator, const size_t &p_reserve)
 Construct a cache from a range of nodes, an allocator and a reserve size.
 
void eraseNode (const Core::FMTOutputNode &node)
 Erase a node from the cache.
 
bool contains (const Core::FMTOutputNode &node) const
 Return true if the cache contains a node.
 
unsigned long long removeLargest ()
 Remove the largest entry of the cache and return the freed memory.
 
const std::vector< tvdescriptor > & getVertices (const Core::FMTOutputNode &targetnode, const std::vector< Core::FMTAction > &actions, const std::vector< Core::FMTTheme > &themes, bool &exactvecticies) const
 Return the vertices for a target node, using the cache.
 
void setValidVertices (const Core::FMTOutputNode &targetnode, const std::vector< tvdescriptor > &vertices) const
 Set the valid vertices for a target node in the cache.
 
void clear ()
 Clear the cache.
 
void rebase (const titerator &beginofdevs, const titerator &endofdevs)
 Rebase the cache on a new range of developments.
 
void insert (const FMTOutputNodeCache &rhs)
 Insert the content of another cache into this cache.
 
void _pushToVector (std::vector< tvdescriptor > &refvecs) const
 Push the nodes of the cache into a vector.
 

Friends

class boost::serialization::access
 

Detailed Description

template<class tvdescriptor, class titerator>
class Graph::FMTOutputNodeCache< tvdescriptor, titerator >

Cache of graph vertices for output nodes, keyed by output source, used to speed up output computation on the graph.

Template Parameters
tvdescriptorthe vertex descriptor type.
titeratorthe iterator type over the vertices.

Constructor & Destructor Documentation

◆ FMTOutputNodeCache() [1/4]

template<class tvdescriptor , class titerator >
Graph::FMTOutputNodeCache< tvdescriptor, titerator >::FMTOutputNodeCache ( )
default

Default constructor for FMTOutputNodeCache.

◆ FMTOutputNodeCache() [2/4]

template<class tvdescriptor , class titerator >
Graph::FMTOutputNodeCache< tvdescriptor, titerator >::FMTOutputNodeCache ( const FMTOutputNodeCache< tvdescriptor, titerator > &  rhs)
default

Copy constructor for FMTOutputNodeCache.

Parameters
[in]rhsthe FMTOutputNodeCache to copy.

◆ ~FMTOutputNodeCache()

template<class tvdescriptor , class titerator >
Graph::FMTOutputNodeCache< tvdescriptor, titerator >::~FMTOutputNodeCache ( )
default

Default destructor for FMTOutputNodeCache.

◆ FMTOutputNodeCache() [3/4]

template<class tvdescriptor , class titerator >
Graph::FMTOutputNodeCache< tvdescriptor, titerator >::FMTOutputNodeCache ( const std::vector< tvdescriptor > &  initialnodes)
inline

Construct a cache from an initial set of nodes.

Parameters
[in]initialnodesthe initial nodes.

◆ FMTOutputNodeCache() [4/4]

template<class tvdescriptor , class titerator >
Graph::FMTOutputNodeCache< tvdescriptor, titerator >::FMTOutputNodeCache ( const titerator &  first,
const titerator &  last,
std::allocator< tvdescriptor > &  p_allocator,
const size_t &  p_reserve 
)
inline

Construct a cache from a range of nodes, an allocator and a reserve size.

Parameters
[in]firstthe first iterator.
[in]lastthe last iterator.
[in]p_allocatorthe allocator.
[in]p_reservethe reserve size.

Member Function Documentation

◆ _pushToVector()

template<class tvdescriptor , class titerator >
void Graph::FMTOutputNodeCache< tvdescriptor, titerator >::_pushToVector ( std::vector< tvdescriptor > &  refvecs) const
inline

Push the nodes of the cache into a vector.

Parameters
[in,out]refvecsthe vector to push into.

◆ clear()

template<class tvdescriptor , class titerator >
void Graph::FMTOutputNodeCache< tvdescriptor, titerator >::clear ( )
inline

Clear the cache.

◆ contains()

template<class tvdescriptor , class titerator >
bool Graph::FMTOutputNodeCache< tvdescriptor, titerator >::contains ( const Core::FMTOutputNode node) const
inline

Return true if the cache contains a node.

Parameters
[in]nodethe node.
Returns
true if the cache contains the node else false.

◆ eraseNode()

template<class tvdescriptor , class titerator >
void Graph::FMTOutputNodeCache< tvdescriptor, titerator >::eraseNode ( const Core::FMTOutputNode node)
inline

Erase a node from the cache.

Parameters
[in]nodethe node to erase.

◆ getVertices()

template<class tvdescriptor , class titerator >
const std::vector< tvdescriptor > & Graph::FMTOutputNodeCache< tvdescriptor, titerator >::getVertices ( const Core::FMTOutputNode targetnode,
const std::vector< Core::FMTAction > &  actions,
const std::vector< Core::FMTTheme > &  themes,
bool &  exactvecticies 
) const
inline

Return the vertices for a target node, using the cache.

Parameters
[in]targetnodethe target node.
[in]actionsthe actions.
[in]themesthe themes.
[out]exactvecticiestrue if the returned vertices are an exact match.
Returns
the vertices for the target node.

◆ insert()

template<class tvdescriptor , class titerator >
void Graph::FMTOutputNodeCache< tvdescriptor, titerator >::insert ( const FMTOutputNodeCache< tvdescriptor, titerator > &  rhs)
inline

Insert the content of another cache into this cache.

Parameters
[in]rhsthe cache to insert.

◆ operator=()

template<class tvdescriptor , class titerator >
FMTOutputNodeCache & Graph::FMTOutputNodeCache< tvdescriptor, titerator >::operator= ( const FMTOutputNodeCache< tvdescriptor, titerator > &  rhs)
default

Copy assignment operator for FMTOutputNodeCache.

Parameters
[in]rhsthe FMTOutputNodeCache to copy.
Returns
a reference to this FMTOutputNodeCache.

◆ rebase()

template<class tvdescriptor , class titerator >
void Graph::FMTOutputNodeCache< tvdescriptor, titerator >::rebase ( const titerator &  beginofdevs,
const titerator &  endofdevs 
)
inline

Rebase the cache on a new range of developments.

Parameters
[in]beginofdevsthe first iterator.
[in]endofdevsthe last iterator.

◆ removeLargest()

template<class tvdescriptor , class titerator >
unsigned long long Graph::FMTOutputNodeCache< tvdescriptor, titerator >::removeLargest ( )
inline

Remove the largest entry of the cache and return the freed memory.

Returns
the amount of freed memory in bytes.

◆ setValidVertices()

template<class tvdescriptor , class titerator >
void Graph::FMTOutputNodeCache< tvdescriptor, titerator >::setValidVertices ( const Core::FMTOutputNode targetnode,
const std::vector< tvdescriptor > &  vertices 
) const
inline

Set the valid vertices for a target node in the cache.

Parameters
[in]targetnodethe target node.
[in]verticesthe vertices to set.

Friends And Related Function Documentation

◆ boost::serialization::access

template<class tvdescriptor , class titerator >
friend class boost::serialization::access
friend

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