template<typename... Ts>
struct clanguml::common::model::element_views< Ts >
Definition at line 103 of file element_view.h.
#include <element_view.h>
◆ dynamic_apply()
template<typename... Ts>
template<typename T , typename F >
Calls f
function on e
if it can be dynamically casted to any type in the element_views.
- Template Parameters
-
T | Element type |
F | Function to call on e |
- Parameters
-
e | Pointer to element |
f | Function to call with e dynamically casted to one of types |
Definition at line 127 of file element_view.h.
128 {
129 if (e == nullptr)
130 return;
131
132 (
133 [&] {
134 if (auto *ptr = dynamic_cast<Ts *>(e); ptr) {
135 f(ptr);
136 }
137 }(),
138 ...);
139 }
◆ for_all_elements() [1/2]
template<typename... Ts>
template<typename F >
Definition at line 104 of file element_view.h.
105 {
106 (f(element_view<Ts>::view()), ...);
107 }
◆ for_all_elements() [2/2]
template<typename... Ts>
template<typename F >
Definition at line 109 of file element_view.h.
110 {
111 (f(element_view<Ts>::view()), ...);
112 }
◆ view()
template<typename... Ts>
template<typename T >
Definition at line 114 of file element_view.h.
115 {
116 return dynamic_cast<const element_view<T> &>(*this);
117 }
The documentation for this struct was generated from the following file: