siplasplas
A library for C++ reflection and introspection
All Classes Functions Variables Typedefs Enumerations Friends Modules Pages
class.hpp
1 #ifndef SIPLASPLAS_REFLECTION_DYNAMIC_CLASS_HPP
2 #define SIPLASPLAS_REFLECTION_DYNAMIC_CLASS_HPP
3 
4 #include "entity.hpp"
5 #include "field.hpp"
6 #include "function.hpp"
7 #include "enum.hpp"
8 #include <siplasplas/typeerasure/typeinfo.hpp>
9 
10 namespace cpp
11 {
12 
13 namespace dynamic_reflection
14 {
15 
20 class SIPLASPLAS_REFLECTION_DYNAMIC_EXPORT Class : public Entity
21 {
22 public:
32  static std::shared_ptr<Class> create(const SourceInfo& sourceInfo, const cpp::typeerasure::TypeInfo& typeInfo);
33 
45  static Class& fromEntity(const std::shared_ptr<Entity>& entity);
46 
57  Enum& enum_(const std::string& name);
58 
69  Class& class_(const std::string& name);
70 
81  Field& field_(const std::string& name);
82 
93  Function& function_(const std::string& name);
94 
98  const cpp::typeerasure::TypeInfo& typeInfo() const;
99 
107  cpp::Any32 create();
108 
109 private:
110  Class(const SourceInfo& sourceInfo, const cpp::typeerasure::TypeInfo& typeInfo);
111 
112  cpp::typeerasure::TypeInfo _typeInfo;
113 };
114 
115 } // dynamic_reflection
116 } // cpp
117 
118 #endif // SIPLASPLAS_REFLECTION_DYNAMIC_CLASS_HPP
Definition: canary_allocator.hpp:7
Stores dynamic reflection information of a class type.
Definition: class.hpp:20
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:115
Represents a C++ semantic entity (Class, function, namespace, etc) and manages its dynamic reflection...
Definition: entity.hpp:22