Class MHO_OperatorToolbox.
More...
#include <MHO_OperatorToolbox.hh>
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()
hops::MHO_OperatorToolbox::MHO_OperatorToolbox |
( |
| ) |
|
|
inline |
◆ ~MHO_OperatorToolbox()
virtual hops::MHO_OperatorToolbox::~MHO_OperatorToolbox |
( |
| ) |
|
|
inlinevirtual |
◆ AddOperator()
void hops::MHO_OperatorToolbox::AddOperator |
( |
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 | Flag indicating whether to replace duplicate operators by name |
◆ 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
◆ GetNOperators()
std::size_t hops::MHO_OperatorToolbox::GetNOperators |
( |
| ) |
|
|
inline |
Getter for number of operators.
- Returns
- Size of fOperators vector as std::size_t
◆ 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
The documentation for this class was generated from the following file: