Catos Engine (Source) 0.0.1
Lightweight Game engine
Loading...
Searching...
No Matches
catos::TypeInfo Class Reference

Typeinfo is an object that holds all information about a specific type. More...

#include <registry.h>

Public Member Functions

template<typename T , typename U >
TypeInfoproperty (const char *property_name, U T::*member, cstr description)
 Registers a property with a name and a member pointer (Returns itself).
 
template<typename ClassT , typename ReturnV , typename... Args>
constexpr TypeInfomethod (const char *method_name, ReturnV(ClassT::*ptr)(Args...), cstr description)
 Registers a method with a name and a member function pointer (returns the Type object again).
 
Propertyget_property (const char *property_name)
 Returns a property object based on the name given.
 
Methodget_method (const char *method_name)
 Returns a method object based on the name given.
 
template<typename T >
void registerToPython ()
 

Static Public Member Functions

static bool is_valid (Property *ptr)
 Checks wether or not the ptr is a nullptr;.
 
static bool is_valid (Method *ptr)
 

Public Attributes

size_t type_hash
 
std::string name
 
std::unordered_map< std::string, Property * > properties
 
std::unordered_map< std::string, Method * > methods
 

Detailed Description

Typeinfo is an object that holds all information about a specific type.

Member Function Documentation

◆ get_method()

Method * catos::TypeInfo::get_method ( const char * method_name)
inline

Returns a method object based on the name given.

◆ get_property()

Property * catos::TypeInfo::get_property ( const char * property_name)
inline

Returns a property object based on the name given.

◆ is_valid() [1/2]

static bool catos::TypeInfo::is_valid ( Method * ptr)
inlinestatic

◆ is_valid() [2/2]

static bool catos::TypeInfo::is_valid ( Property * ptr)
inlinestatic

Checks wether or not the ptr is a nullptr;.

◆ method()

template<typename ClassT , typename ReturnV , typename... Args>
constexpr TypeInfo & catos::TypeInfo::method ( const char * method_name,
ReturnV(ClassT::*)(Args...) ptr,
cstr description )
inlineconstexpr

Registers a method with a name and a member function pointer (returns the Type object again).

◆ property()

template<typename T , typename U >
TypeInfo & catos::TypeInfo::property ( const char * property_name,
U T::* member,
cstr description )
inline

Registers a property with a name and a member pointer (Returns itself).

◆ registerToPython()

template<typename T >
void catos::TypeInfo::registerToPython ( )
inline

Member Data Documentation

◆ methods

std::unordered_map<std::string , Method* > catos::TypeInfo::methods

◆ name

std::string catos::TypeInfo::name

◆ properties

std::unordered_map<std::string , Property* > catos::TypeInfo::properties

◆ type_hash

size_t catos::TypeInfo::type_hash

The documentation for this class was generated from the following file: