Temporary delegate for notificaiton invokation until the implementation is working. This will then be merged with sparta::SpartaHandler.
More...
#include <TreeNode.hpp>
|
| delegate (const delegate &&d) |
|
delegate & | operator= (const delegate &d) |
|
| delegate (const delegate &d) |
|
template<class DataT , class T , void(T::*)(const TreeNode &, const TreeNode &, const DataT &) TMethod> |
constexpr bool | equals (T *obj, const TreeNode &obs_pt, const std::string &name) const |
| Compares against another delegate's information based on DataT, T, TMethod, observer pointer, and the observation point in the tree.
|
|
template<class DataT , class T , void(T::*)(const DataT &) TMethod> |
constexpr bool | equals (T *obj, const TreeNode &obs_pt, const std::string &name) const |
|
bool | operator== (const delegate &d) const |
| Compares all fields in this delegate against another delegate.
|
|
bool | observes (const TreeNode &obs_pt, const std::string *name) const |
| Compares against another delegate based on the observation point and name ignoring delegate callback signature (assumes it alreay matches).
|
|
template<typename DataT > |
void | operator() (const TreeNode &origin, const DataT &data) const |
| Invokes the delegate.
|
|
const std::string * | getNameID () const |
|
const TreeNode * | getObservationPoint () const |
|
bool | revealsOrigin () const |
|
|
template<class DataT , class T , void(T::*)(const TreeNode &, const TreeNode &, const DataT &) TMethod> |
static delegate | from_method (T *obj, const TreeNode &obs_pt, const std::string &name) |
| Creates delegate with given properties.
|
|
template<class DataT , class T , void(T::*)(const DataT &) TMethod> |
static delegate | from_method (T *obj, const TreeNode &obs_pt, const std::string &name) |
|
Temporary delegate for notificaiton invokation until the implementation is working. This will then be merged with sparta::SpartaHandler.
- Note
- This class must be mostly inlined (constructors, queries, comparisons, and calls) for performance
Definition at line 2761 of file TreeNode.hpp.
◆ stub_type
typedef void(* sparta::TreeNode::delegate::stub_type) (void *obj, const TreeNode &origin, const TreeNode *obs_pt, const void *data) |
◆ delegate() [1/3]
sparta::TreeNode::delegate::delegate |
( |
| ) |
|
|
inline |
◆ delegate() [2/3]
sparta::TreeNode::delegate::delegate |
( |
const delegate && |
d | ) |
|
|
inline |
◆ delegate() [3/3]
sparta::TreeNode::delegate::delegate |
( |
const delegate & |
d | ) |
|
|
inline |
◆ equals() [1/2]
template<class DataT , class T , void(T::*)(const
TreeNode &, const
TreeNode &, const DataT &) TMethod>
constexpr bool sparta::TreeNode::delegate::equals |
( |
T * |
obj, |
|
|
const TreeNode & |
obs_pt, |
|
|
const std::string & |
name |
|
) |
| const |
|
inlineconstexpr |
Compares against another delegate's information based on DataT, T, TMethod, observer pointer, and the observation point in the tree.
- Note
- It is critical to compare observer point to ensure that observers of a particular event type can be registered on multiple nodes.
Definition at line 2819 of file TreeNode.hpp.
◆ equals() [2/2]
template<class DataT , class T , void(T::*)(const DataT &) TMethod>
constexpr bool sparta::TreeNode::delegate::equals |
( |
T * |
obj, |
|
|
const TreeNode & |
obs_pt, |
|
|
const std::string & |
name |
|
) |
| const |
|
inlineconstexpr |
◆ from_method() [1/2]
template<class DataT , class T , void(T::*)(const
TreeNode &, const
TreeNode &, const DataT &) TMethod>
static delegate sparta::TreeNode::delegate::from_method |
( |
T * |
obj, |
|
|
const TreeNode & |
obs_pt, |
|
|
const std::string & |
name |
|
) |
| |
|
inlinestatic |
Creates delegate with given properties.
- Parameters
-
name | Name of notifications to observe. Passing empty string observes all notifications with payload type DataT |
Definition at line 2888 of file TreeNode.hpp.
◆ from_method() [2/2]
template<class DataT , class T , void(T::*)(const DataT &) TMethod>
static delegate sparta::TreeNode::delegate::from_method |
( |
T * |
obj, |
|
|
const TreeNode & |
obs_pt, |
|
|
const std::string & |
name |
|
) |
| |
|
inlinestatic |
◆ getNameID()
const std::string * sparta::TreeNode::delegate::getNameID |
( |
| ) |
const |
|
inline |
◆ getObservationPoint()
const TreeNode * sparta::TreeNode::delegate::getObservationPoint |
( |
| ) |
const |
|
inline |
◆ observes()
bool sparta::TreeNode::delegate::observes |
( |
const TreeNode & |
obs_pt, |
|
|
const std::string * |
name |
|
) |
| const |
|
inline |
Compares against another delegate based on the observation point and name ignoring delegate callback signature (assumes it alreay matches).
- Parameters
-
obs_pt | Observation point to compare against this delegate. Just checks to see if they match. |
name | String name of notification in question. This string must be interned in StringManager. This delegate's name will be compared to the name argument by address unless the delegate has a name pointer of StringManager::EMPTY (implying it observes all notification names of a given data type) |
- Returns
- true if both:
- This delegate has the same observation point as obs_pt
- This delegate has either a name matching the name argument or the delegate name StringManager::EMPTY (empty string) (this implies that the delegate observes all notification names for the given data type)
Definition at line 2873 of file TreeNode.hpp.
◆ operator()()
template<typename DataT >
void sparta::TreeNode::delegate::operator() |
( |
const TreeNode & |
origin, |
|
|
const DataT & |
data |
|
) |
| const |
|
inline |
◆ operator=()
- Note
- This is required for placing delegates in a vector (for fast iteration during broadcast) despite also having a move constructor.
Definition at line 2789 of file TreeNode.hpp.
◆ operator==()
bool sparta::TreeNode::delegate::operator== |
( |
const delegate & |
d | ) |
const |
|
inline |
Compares all fields in this delegate against another delegate.
- Returns
- true if all fields are equal (e.g. same stub pointer, same observation point, observer object, and observation name)
- See also
- equals
Definition at line 2848 of file TreeNode.hpp.
◆ revealsOrigin()
bool sparta::TreeNode::delegate::revealsOrigin |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: