Base class for elements nested in the diagram. More...
Base class for elements nested in the diagram.
This class provides a common trait for diagram elements which can contain other nested elements, e.g. packages.
T | Type of element |
Path | Type of nested path (e.g. namespace or directory path) |
Definition at line 41 of file nested_trait.h.
#include <nested_trait.h>
Public Member Functions | |
nested_trait ()=default | |
nested_trait (const nested_trait &)=delete | |
nested_trait (nested_trait &&) noexcept=default | |
nested_trait & | operator= (const nested_trait &)=delete |
nested_trait & | operator= (nested_trait &&) noexcept=default |
virtual | ~nested_trait ()=default |
bool | is_root () const |
void | is_root (bool a) |
template<typename V = T> | |
bool | add_element (std::unique_ptr< V > p) |
template<typename V = T> | |
bool | add_element (const Path &path, std::unique_ptr< V > p) |
template<typename V = T> | |
auto | get_element (const Path &path) const |
template<typename V = T> | |
auto | get_element (const std::string &name, bool is_root=false) const |
template<typename F > | |
bool | all_of (F &&f) const |
bool | is_empty (bool include_inner_packages=false) const |
auto | begin () |
auto | end () |
auto | cbegin () const |
auto | cend () const |
auto | begin () const |
auto | end () const |
void | print_tree (const int level) const |
void | remove (const std::set< eid_t > &element_ids) |
Private Member Functions | |
bool | has_element (const std::string &name) const |
Private Attributes | |
bool | is_root_ {false} |
std::set< std::pair< eid_t, std::string > > | added_elements_ |
std::vector< std::unique_ptr< T > > | elements_ |
std::multimap< std::string, size_t > | elements_by_name_ |
|
default |
|
delete |
|
defaultnoexcept |
|
virtualdefault |
|
inline |
Add element at a nested path.
V | Type of element |
path | Nested path (e.g. list of namespaces) |
p | Element |
Definition at line 90 of file nested_trait.h.
|
inline |
Add element at the current nested level.
V | Type of element |
p | Element |
Definition at line 65 of file nested_trait.h.
|
inline |
Return result of functor f applied to all_of elements.
F | Functor type |
f | Functor value |
Definition at line 203 of file nested_trait.h.
|
inline |
Definition at line 239 of file nested_trait.h.
|
inline |
Definition at line 245 of file nested_trait.h.
|
inline |
Definition at line 242 of file nested_trait.h.
|
inline |
Definition at line 243 of file nested_trait.h.
|
inline |
Definition at line 240 of file nested_trait.h.
|
inline |
Definition at line 246 of file nested_trait.h.
|
inline |
Get element at path, if exists.
V | Element type. |
path | Path to the element. |
Definition at line 126 of file nested_trait.h.
|
inline |
Get element by name at the current nested level.
V | Type of element. |
name | Name of the element (cannot contain namespace or path) |
Definition at line 157 of file nested_trait.h.
|
inlineprivate |
Returns true of this nested level contains an element with specified name.
name | Name of the element. |
Definition at line 325 of file nested_trait.h.
|
inline |
Check if nested element is empty.
Definition at line 222 of file nested_trait.h.
|
inline |
Definition at line 53 of file nested_trait.h.
|
inline |
Definition at line 55 of file nested_trait.h.
|
delete |
|
defaultnoexcept |
|
inline |
Print the nested trait in the form of a tree.
This method is used for debugging only.
level | Tree level |
Definition at line 255 of file nested_trait.h.
|
inline |
Definition at line 274 of file nested_trait.h.
|
private |
Definition at line 332 of file nested_trait.h.
|
private |
Definition at line 333 of file nested_trait.h.
|
private |
Definition at line 334 of file nested_trait.h.
|
private |
Definition at line 330 of file nested_trait.h.