FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Core::FMTActionComparator Class Reference

Comparator used to check if an action name (or aggregate) already exists in a std container. More...

#include <FMTAction.h>

Public Member Functions

 FMTActionComparator (std::string p_name, bool lcheckaggregate=false)
 Construct the comparator from the action name to match.
 
std::vector< const FMTAction * > getAllAggregates (const std::vector< FMTAction > &actions, bool aggregateonly=false) const
 Return the actions matching the action name, or only the matching aggregates.
 
std::unordered_set< int > getAllAggregatesSet (const std::vector< FMTAction > &actions, bool aggregateonly=false) const
 Return the ids of the actions matching the action name, or only the matching aggregates.
 
bool operator() (const FMTAction &action) const
 Matching test operator for the comparator.
 

Detailed Description

Comparator used to check if an action name (or aggregate) already exists in a std container.

Constructor & Destructor Documentation

◆ FMTActionComparator()

Core::FMTActionComparator::FMTActionComparator ( std::string  p_name,
bool  lcheckaggregate = false 
)

Construct the comparator from the action name to match.

Parameters
[in]p_namethe name of the action to match.
[in]lcheckaggregateif true also returns actions within the named aggregate.

Member Function Documentation

◆ getAllAggregates()

std::vector< const FMTAction * > Core::FMTActionComparator::getAllAggregates ( const std::vector< FMTAction > &  actions,
bool  aggregateonly = false 
) const

Return the actions matching the action name, or only the matching aggregates.

Parameters
[in]actionsthe actions to search.
[in]aggregateonlyif true only returns matching aggregates.
Returns
the matching actions.

◆ getAllAggregatesSet()

std::unordered_set< int > Core::FMTActionComparator::getAllAggregatesSet ( const std::vector< FMTAction > &  actions,
bool  aggregateonly = false 
) const

Return the ids of the actions matching the action name, or only the matching aggregates.

Parameters
[in]actionsthe actions to search.
[in]aggregateonlyif true only returns matching aggregates.
Returns
the ids of the matching actions.

◆ operator()()

bool Core::FMTActionComparator::operator() ( const FMTAction action) const

Matching test operator for the comparator.

Parameters
[in]actionthe action to test.
Returns
true if the action matches else false.

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