Class MHO_OperatorToolbox.
More...
#include <MHO_OperatorToolbox.hh>
|
| | MHO_OperatorToolbox () |
| |
| | MHO_OperatorToolbox (const MHO_OperatorToolbox &)=delete |
| |
| virtual | ~MHO_OperatorToolbox () |
| |
| void | AddOperator (std::unique_ptr< MHO_Operator > op, const std::string &name, const std::string &category, bool replace_duplicate=true) |
| | Adds an operator to the toolbox with optional replacement if duplicate name exists. More...
|
| |
| std::vector< MHO_Operator * > | GetAllOperators () |
| | Getter for all operators (vector of pointers) More...
|
| |
| std::vector< MHO_Operator * > | GetAllOperatorsByName (const std::string &name) |
| | Getter for all operators with the given name - returns all operators whose name matches, sorted by priority. Use this when multiple operators may share the same name. More...
|
| |
| std::size_t | GetNOperators () |
| | Getter for number of operators. More...
|
| |
| std::size_t | GetNOperatorsInCategory (const std::string &cat) |
| |
| MHO_Operator * | GetOperator (const char *name) |
| | Getter for an operator by name. More...
|
| |
| MHO_Operator * | GetOperator (const std::string &name) |
| | Getter for operator - retrieval by name as generic operator, returns nullptr if missing. More...
|
| |
| template<typename XOperatorType > |
| XOperatorType * | GetOperatorAs (const std::string &name) |
| | Getter for operator, retrieval by name, with cast to specified type (XOperatorType), if missing returns nullptr. More...
|
| |
| std::vector< MHO_Operator * > | GetOperatorsByCategory (const std::string &category) |
| | Getter for operators by category. More...
|
| |
| std::vector< MHO_Operator * > | GetOperatorsByPriorityRange (double lower_limit, double upper_limit) |
| | Getter for operators by priority range - get all operators within the priority range [low,high) More...
|
| |
| MHO_OperatorToolbox & | operator= (const MHO_OperatorToolbox &)=delete |
| |
| void | PrintOperatorNames () |
| |
Class MHO_OperatorToolbox.
The toolbox class stores all operator objects as points to the MHO_Operator base class.
- Author
- J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du
- Date
- Sun Jun 4 17:43:54 2023 -0400
◆ MHO_OperatorToolbox() [1/2]
| hops::MHO_OperatorToolbox::MHO_OperatorToolbox |
( |
| ) |
|
|
inline |
◆ MHO_OperatorToolbox() [2/2]
◆ ~MHO_OperatorToolbox()
| virtual hops::MHO_OperatorToolbox::~MHO_OperatorToolbox |
( |
| ) |
|
|
inlinevirtual |
◆ AddOperator()
| void hops::MHO_OperatorToolbox::AddOperator |
( |
std::unique_ptr< MHO_Operator > |
op, |
|
|
const std::string & |
name, |
|
|
const std::string & |
category, |
|
|
bool |
replace_duplicate = true |
|
) |
| |
|
inline |
Adds an operator to the toolbox with optional replacement if duplicate name exists.
- Parameters
-
| op | Pointer to the MHO_Operator to be added |
| name | Name of the operator (duplicate names can be replaced) |
| category | Category under which the operator will be stored |
| replace_duplicate | If true, an existing operator with the same name is removed first. If false, the new operator is added alongside any same-named ones, GetOperator(name) then returns the most recently added, while GetAllOperatorsByName(name) retrieves all of them sorted by priority. |
◆ GetAllOperators()
| std::vector< MHO_Operator* > hops::MHO_OperatorToolbox::GetAllOperators |
( |
| ) |
|
|
inline |
Getter for all operators (vector of pointers)
- Returns
- std::vector<MHO_Operator* sorted list of operators
◆ GetAllOperatorsByName()
| std::vector< MHO_Operator* > hops::MHO_OperatorToolbox::GetAllOperatorsByName |
( |
const std::string & |
name | ) |
|
|
inline |
Getter for all operators with the given name - returns all operators whose name matches, sorted by priority. Use this when multiple operators may share the same name.
- Parameters
-
| name | Operator name to search for |
- Returns
- Vector of MHO_Operator pointers sorted by priority
◆ GetNOperators()
| std::size_t hops::MHO_OperatorToolbox::GetNOperators |
( |
| ) |
|
|
inline |
Getter for number of operators.
- Returns
- Size of fOperators vector as std::size_t
◆ GetNOperatorsInCategory()
| std::size_t hops::MHO_OperatorToolbox::GetNOperatorsInCategory |
( |
const std::string & |
cat | ) |
|
|
inline |
◆ GetOperator() [1/2]
| MHO_Operator* hops::MHO_OperatorToolbox::GetOperator |
( |
const char * |
name | ) |
|
|
inline |
Getter for an operator by name.
- Parameters
-
| name | Operator name to search for in the map |
- Returns
- Pointer to MHO_Operator or nullptr if not found
◆ GetOperator() [2/2]
| MHO_Operator* hops::MHO_OperatorToolbox::GetOperator |
( |
const std::string & |
name | ) |
|
|
inline |
Getter for operator - retrieval by name as generic operator, returns nullptr if missing.
- Parameters
-
| name | Operator name to search for in the map |
- Returns
- Pointer to MHO_Operator or nullptr if not found
◆ GetOperatorAs()
template<typename XOperatorType >
| XOperatorType* hops::MHO_OperatorToolbox::GetOperatorAs |
( |
const std::string & |
name | ) |
|
|
inline |
Getter for operator, retrieval by name, with cast to specified type (XOperatorType), if missing returns nullptr.
- Parameters
-
| name | Operator name to retrieve |
- Returns
- Pointer to operator cast as XOperatorType or nullptr if not found/cannot be cast
◆ GetOperatorsByCategory()
| std::vector< MHO_Operator* > hops::MHO_OperatorToolbox::GetOperatorsByCategory |
( |
const std::string & |
category | ) |
|
|
inline |
Getter for operators by category.
- Parameters
-
| category | The category of operators to retrieve. |
- Returns
- A vector of MHO_Operator pointers sorted by priority.
◆ GetOperatorsByPriorityRange()
| std::vector< MHO_Operator* > hops::MHO_OperatorToolbox::GetOperatorsByPriorityRange |
( |
double |
lower_limit, |
|
|
double |
upper_limit |
|
) |
| |
|
inline |
Getter for operators by priority range - get all operators within the priority range [low,high)
- Parameters
-
| lower_limit | Lower bound of priority range |
| upper_limit | Upper bound of priority range |
- Returns
- Vector of MHO_Operator pointers sorted by priority
◆ operator=()
◆ PrintOperatorNames()
| void hops::MHO_OperatorToolbox::PrintOperatorNames |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following file: