1 #ifndef SIPLASPLAS_REFLECTION_DYNAMIC_ENTITY_HPP 2 #define SIPLASPLAS_REFLECTION_DYNAMIC_ENTITY_HPP 4 #include "sourceinfo.hpp" 5 #include "detail/runtime_forward.hpp" 6 #include <siplasplas/reflection/dynamic/export.hpp> 9 #include <unordered_set> 14 namespace dynamic_reflection
22 class SIPLASPLAS_REFLECTION_DYNAMIC_EXPORT
Entity :
public std::enable_shared_from_this<Entity>
25 virtual ~
Entity() =
default;
43 const SourceInfo& sourceInfo()
const;
48 const std::string& name()
const;
53 const std::string& fullName()
const;
65 bool detached()
const;
92 void attach(
const std::weak_ptr<Entity>& parent);
105 void addChild(
const std::shared_ptr<Entity>& entity);
114 bool isChild(
const std::shared_ptr<Entity>& entity)
const;
123 bool isChild(
const Entity& entity)
const;
134 bool isChildByName(
const std::string& name)
const;
145 bool isChildByFullName(
const std::string& fullName)
const;
157 Entity& getChildByFullName(
const std::string& fullName);
169 Entity& getChildByName(
const std::string& name);
191 std::vector<std::string> getChildrenNamesByKind(
const SourceInfo::Kind& kind);
196 std::shared_ptr<Entity> pointer();
202 friend bool operator==(
const Entity& lhs,
const Entity& rhs);
211 friend bool operator!=(
const Entity& lhs,
const Entity& rhs);
214 Entity(
const SourceInfo& sourceInfo);
217 std::weak_ptr<Entity> _parent;
219 SourceInfo _sourceInfo;
220 std::unordered_set<std::string> _children;
227 #endif // SIPLASPLAS_REFLECTION_DYNAMIC_ENTITY_HPP Definition: canary_allocator.hpp:7
Provides access to dynamic type and function information at runtime.
Definition: runtime.hpp:16
Kind
Represents the different types of entities (namespaces, classes, functions, etc) the library can coll...
Definition: sourceinfo.hpp:24
Represents a C++ semantic entity (Class, function, namespace, etc) and manages its dynamic reflection...
Definition: entity.hpp:22