A container class to manage a collection of function arguments.
More...
#include <codac2_FunctionArgsList.h>
A container class to manage a collection of function arguments.
◆ FunctionArgsList() [1/3]
Copy constructor.
Each argument is deep-copied using its arg_copy()
method.
- Parameters
-
42 : std::vector<std::shared_ptr<VarBase>>(args.size())
43 {
44 size_t i = 0;
45 for(const auto& arg : args)
46 (*this)[i++] = arg->arg_copy();
47 compute_unique_arg_names();
48 }
◆ FunctionArgsList() [2/3]
codac2::FunctionArgsList::FunctionArgsList |
( |
std::initializer_list< std::reference_wrapper< VarBase > > | args | ) |
|
|
inline |
Constructor to initialize a FunctionArgsList
from an initializer list of references to VarBase
objects.
Each argument is deep-copied by calling its arg_copy()
on the referenced objects.
- Parameters
-
args | An initializer list of references to VarBase objects. |
60 { }
FunctionArgsList()
Default constructor. It creates an empty list of arguments.
Definition codac2_FunctionArgsList.h:31
◆ FunctionArgsList() [3/3]
codac2::FunctionArgsList::FunctionArgsList |
( |
const std::vector< std::reference_wrapper< VarBase > > & | args | ) |
|
|
inline |
Constructor to initialize a FunctionArgsList
from a vector of of references to VarBase
objects.
Each argument is deep-copied by calling its arg_copy()
on the referenced objects.
- Parameters
-
args | An initializer list of references to VarBase objects. |
71 {
72 for(const auto& arg : args)
73 push_back(arg.get().arg_copy());
74 compute_unique_arg_names();
75 }
◆ total_size()
Index codac2::FunctionArgsList::total_size |
( |
| ) |
const |
|
inline |
Calculates the total size of the function arguments, as the sum of the sizes of each argument.
- Returns
- The sum of the sizes of all arguments.
84 {
85 Index n = 0;
86 for(const auto& ai : *this)
87 n += ai->size();
88 return n;
89 }
The documentation for this class was generated from the following file: