Member Class Reference

#include <reflectionbase.h>

Inheritance diagram for Member:

Detailed Description

Member is the root interface of the reflection hierarchy. A Member may be

All members except the global package have an enclosing container as their parent. For example, the method StringInterface::GetLength() has the class StringInterface as enclosing container, which has the maxon package as enclosing container, which has the global package as enclosing container.

Public Types

enum class  KIND {

Public Member Functions

enum maxon::reflection::Member::KIND MAXON_ENUM_FLAGS_CLASS (KIND)
MAXON_METHOD const ContainerGetEnclosingContainer () const
MAXON_METHOD KIND GetKind () const
MAXON_METHOD const IdGetSimpleName () const
MAXON_METHOD const IdGetId () const
MAXON_METHOD String ToString (const FormatStatement *fs=nullptr) const

Static Public Member Functions

static MAXON_METHOD Result< BoolGetMembers (const ValueReceiver< const Member & > &members)
static MAXON_METHOD const MemberFind (const Id &memberId)

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (Member, MAXON_REFERENCE_NONE, "net.maxon.reflection.interface.member")

Member Enumeration Documentation


enum KIND

This enum defines the possible kinds of a Member. Exactly one of the flags is set in the value returned by GetKind().


The member is a Package.


The member is a Class.


The member is a Function (either at package scope, or a static class member).


The member is a non-const instance function (i.e., non-static class member).


The member is a const instance function (i.e., non-static class member).


Member Function Documentation




enum maxon::reflection::Member::KIND MAXON_ENUM_FLAGS_CLASS ( KIND  )

◆ GetEnclosingContainer()

MAXON_METHOD const Container* GetEnclosingContainer ( ) const

Returns the enclosing container of this member. All members except the global package have such an enclosing container: Functions and classes are nested in classes or packages, packages are nested in other packages.

The enclosing container of this member, or nullptr if this is the global package.

◆ GetKind()

MAXON_METHOD KIND GetKind ( ) const

Returns the kind of this member. This allows to tell whether this Member can be safely cast to a Package, Class or Function. The returned value has exactly one of the KIND flags set.

Kind of this member.

◆ GetSimpleName()

MAXON_METHOD const Id& GetSimpleName ( ) const

Returns the (unqualified) name of this member. E.g., for maxon::StringInterface::GetLength this is "GetLength".

Name of this member.

◆ GetId()

MAXON_METHOD const Id& GetId ( ) const

Returns a unique id for this member. This is the qualified name of the member (with dot as separator), plus optionally an additional code for disambiguation, separated by "@". For functions, a hashcode which depends on the parameter and return types is used to disambiguate between overloads (such as "net.maxon.asin@919429e0").

The function Find() allows to find a Member for the id.

Unique id for this member.

◆ ToString()

MAXON_METHOD String ToString ( const FormatStatement fs = nullptr) const

Returns a readable string of the content.

[in]fsNullptr or additional formatting instruction. Currently no additional formatting instructions are supported.
The converted result.

◆ GetMembers()

static MAXON_METHOD Result<Bool> GetMembers ( const ValueReceiver< const Member & > &  members)

Yields all registered members.

◆ Find()

static MAXON_METHOD const Member* Find ( const Id memberId)

Finds the member whose id is memberId. The id has to be in a format as specified by GetId(). If there is no member with the given memberId, nullptr is returned.

[in]memberIdA member id.
The member with the given memberId, or nullptr.