8#ifndef SEN_CORE_META_METHOD_H
9#define SEN_CORE_META_METHOD_H
56using PropertyRelation = std::variant<NonPropertyRelated, PropertyGetter, PropertySetter>;
79 return lhs.callableSpec == rhs.callableSpec && lhs.constness == rhs.constness && lhs.deferred == rhs.deferred &&
80 lhs.returnType == rhs.returnType;
130 [[nodiscard]]
bool operator==(const
Method& other) const noexcept;
133 [[nodiscard]]
bool operator!=(const
Method& other) const noexcept;
Here we define a set of template meta-programming helpers to let the compiler take some decisions bas...
Callable(CallableSpec spec)
Copies the spec into a member.
bool getDeferred() const noexcept
True if the method is marked as deferred.
ConstTypeHandle getReturnType() const noexcept
Gets the return type of the method (nullptr means void).
Method(const MethodSpec &spec, Private notUsable)
Copies the spec into a member. Private to prevent direct instances.
~Method() override=default
MemberHash getHash() const noexcept
Returns a unique hash to identify the method.
static std::shared_ptr< Method > make(MethodSpec spec)
Factory function that validates the spec and creates a method. Throws std::exception if the spec is n...
Constness getConstness() const noexcept
The constness of the method.
const PropertyRelation & getPropertyRelation() const noexcept
Information about the relation to a property.
MemberHash getId() const noexcept
Returns the hash of the method's unqualified name.
bool getLocalOnly() const noexcept
True if the method is the method is only locally available (within the same component).
Represents a property.
Definition property.h:79
constexpr u32 hashSeed
Initial seed for all hashes.
Definition hash32.h:33
u32 hashCombine(u32 seed, const Types &... args) noexcept
Combines the hash of different values into a single 32-bit hash.
Definition hash32.h:214
#define SEN_PRIVATE_TAG
Definition compiler_macros.h:490
const Property * property
Definition method.h:46
const Property * property
Definition method.h:52
std::variant< NonPropertyRelated, PropertyGetter, PropertySetter > PropertyRelation
Information about the relation between a method and a property.
Definition method.h:56
Constness
Method constness.
Definition method.h:33
TypeHandle< const T > ConstTypeHandle
Definition type.h:319
@ nonConstant
Definition method.h:35
@ constant
Definition method.h:34
Indicates that the method represents a getter of a property.
Definition method.h:45
Indicates that the method represents a setter of a property.
Definition method.h:51
uint32_t u32
Definition numbers.h:25
This file contains functions related to hashing and compression. This is mainly used by Sen internals...
Data of a callable.
Definition callable.h:69
The hash of a member.
Definition type.h:39
Data of a method.
Definition method.h:60
CallableSpec callableSpec
Definition method.h:86
PropertyRelation propertyRelation
Definition method.h:89
ConstTypeHandle returnType
Definition method.h:88
friend bool operator==(const MethodSpec &lhs, const MethodSpec &rhs) noexcept
Definition method.h:77
bool deferred
Definition method.h:90
friend bool operator!=(const MethodSpec &lhs, const MethodSpec &rhs) noexcept
Definition method.h:83
MethodSpec(CallableSpec callableSpec, ConstTypeHandle<> returnType, Constness constness=Constness::nonConstant, PropertyRelation propertyRelation=NonPropertyRelated {}, bool deferred=false, bool localOnly=false)
Definition method.h:61
Constness constness
Definition method.h:87
bool localOnly
Definition method.h:91