Refureku v2.2.0
C++17 runtime reflection library.
NamespaceFragment.h
1
8#pragma once
9
10#include "Refureku/TypeInfo/Entity/Entity.h"
11
12namespace rfk
13{
14 //Forward declaration
15 class Namespace;
16
17 class NamespaceFragment final : public Entity
18 {
19 public:
20 REFUREKU_API NamespaceFragment(char const* name,
21 std::size_t id = 0u) noexcept;
23 REFUREKU_API ~NamespaceFragment() noexcept;
24
32 REFUREKU_API void addNestedEntity(Entity const& nestedEntity) noexcept;
33
41 REFUREKU_API void setNestedEntitiesCapacity(std::size_t capacity) noexcept;
42
52 REFUREKU_API bool addProperty(Property const& property) noexcept;
53
59 REFUREKU_API Namespace const& getMergedNamespace() const noexcept;
60
72 REFUREKU_INTERNAL bool foreachNestedEntity(Visitor<Entity> visitor,
73 void* userData) const;
74
78 REFUREKU_INTERNAL void unmergeFragment() const noexcept;
79
80 private:
81 //Forward declaration
82 class NamespaceFragmentImpl;
83
84 RFK_GEN_GET_PIMPL(NamespaceFragmentImpl, Entity::getPimpl())
85 };
86}
Definition: Entity.h:29
Definition: NamespaceFragment.h:18
REFUREKU_API void setNestedEntitiesCapacity(std::size_t capacity) noexcept
Set the number of nested entities for this entity. Useful to avoid reallocations when adding a lot of...
REFUREKU_API bool addProperty(Property const &property) noexcept
Add a property to this namespace fragment. The property is immediately added to the merged namespace.
REFUREKU_API Namespace const & getMergedNamespace() const noexcept
Get the namespace this fragment is merged to.
REFUREKU_INTERNAL bool foreachNestedEntity(Visitor< Entity > visitor, void *userData) const
Execute the given visitor on all nested entities.
REFUREKU_INTERNAL void unmergeFragment() const noexcept
Unmerge the fragment from the merged namespace.
REFUREKU_API void addNestedEntity(Entity const &nestedEntity) noexcept
Add a nested entity to the namespace.
Definition: Namespace.h:26
Base class to inherit from to define new properties.
Definition: Property.h:23
Definition: Allocator.h:16
bool(*)(T const &value, void *userData) Visitor
Visitor function.
Definition: Visitor.h:21