OSFEG-C++
1.4.6
OpenSF Error Generation Library
|
#include <Composite.h>
Public Member Functions | |
Composite () | |
Composite (const Composite &)=delete | |
Composite & | operator= (const Composite &)=delete |
Composite (Composite &&)=default | |
Composite & | operator= (Composite &&)=default |
virtual | ~Composite () |
void | add (Composite *node) |
void | remove (Composite *node) |
Composite * | getChild (int index) |
bool | hasChildNodes () const |
virtual double | getValue (double time) |
Protected Attributes | |
std::vector< Composite * > | children |
Composite * | parent |
Class Composite represents a node in the perturbations tree. Each node may have any number of children nodes, forming a directed acyclic graph (DAG).
Composite::Composite | ( | ) |
Default class constructor, creates a node with no children and no parent.
|
delete |
Disallow copying but allow moving
|
default |
Disallow copying but allow moving
|
virtual |
Cleans up resources owned by this object, including its owned children nodes.
void Composite::add | ( | Composite * | node | ) |
Composite* Composite::getChild | ( | int | index | ) |
Returns the child pointed by index
index | Index of the desired child |
|
virtual |
Returns the scalar value of this node at the given time. Implementations may check the number of children nodes and the value of some or all of them, either at the same or at a different time, for the evaluation of this function. If the number or value of those children are considered invalid for any reason, this function may throw.
The default implementation ignores all children nodes and simply returns zero.
time | Time reference of the perturbation |
Reimplemented in Stochastic, Step, Sampled, Polynomial, Harmonic, BinaryOperations, and Analytical.
bool Composite::hasChildNodes | ( | ) | const |
Checks whether the Composite object has children.
void Composite::remove | ( | Composite * | node | ) |
|
protected |
Children nodes of this composite. A node owns its children, and so they are destroyed when their parent is.
|
protected |
Pointer to the parent node, may be null.