siplasplas
A library for C++ reflection and introspection
class.hpp
1 #ifndef SIPLASPLAS_REFLECTION_DYNAMIC_CLASS_HPP
2 #define SIPLASPLAS_REFLECTION_DYNAMIC_CLASS_HPP
3 
4 #include "field.hpp"
5 #include "function.hpp"
6 #include "entity.hpp"
7 #include "enum.hpp"
8 #include "type.hpp"
9 #include <siplasplas/typeerasure/typeinfo.hpp>
10 
11 namespace cpp
12 {
13 
14 namespace dynamic_reflection
15 {
16 
21 class SIPLASPLAS_REFLECTION_DYNAMIC_EXPORT Class : public Entity
22 {
23 public:
33  static std::shared_ptr<Class> create(const SourceInfo& sourceInfo, const cpp::typeerasure::TypeInfo& typeInfo);
34 
46  static Class& fromEntity(const std::shared_ptr<Entity>& entity);
47 
58  Enum& enum_(const std::string& name);
59 
70  Class& class_(const std::string& name);
71 
82  Field& field_(const std::string& name);
83 
94  Function& function_(const std::string& name);
95 
99  const cpp::typeerasure::TypeInfo& typeInfo() const;
100 
108  cpp::Any32 create();
109 
110 private:
111  Class(const SourceInfo& sourceInfo, const cpp::typeerasure::TypeInfo& typeInfo);
112 
113  cpp::typeerasure::TypeInfo _typeInfo;
114 };
115 
116 } // dynamic_reflection
117 } // cpp
118 
119 #endif // SIPLASPLAS_REFLECTION_DYNAMIC_CLASS_HPP
Definition: canary_allocator.hpp:7
Stores dynamic reflection information of a class type.
Definition: class.hpp:21
Stires dynamic reflection information of a function.
Definition: function.hpp:17
Stores dynamic reflection information of an enumeration type.
Definition: enum.hpp:18
Stores dynamic reflection information of a member object.
Definition: field.hpp:23
Implements a type-erased object container with support for dynamic method and attribute invokation...
Definition: any.hpp:47
Contains minimal information to execute the value semantics operations of a type. ...
Definition: typeinfo.hpp:113
Represents a C++ semantic entity (Class, function, namespace, etc) and manages its dynamic reflection...
Definition: entity.hpp:22