Container Class Reference

#include <reflectionbase.h>

Inheritance diagram for Container:

Detailed Description

Container is the base interface of members which may contain other members, i.e., of packages and classes. Correspondingly, there are two derived interfaces Package and Class.

Public Member Functions

MAXON_METHOD Block< const Class *const > GetClasses () const
 
MAXON_METHOD const ClassFindClass (const Id &name) const
 
MAXON_METHOD Block< const Function *const > GetFunctions () const
 
MAXON_METHOD Result< const Function * > FindFunction (const Id &name) const
 
MAXON_METHOD Result< void > FindFunctions (const Id &name, const ValueReceiver< const Function * > &result) const
 
- Public Member Functions inherited from Member
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 const ContainerFind (const Id &memberId)
 
- Static Public Member Functions inherited from Member
static MAXON_METHOD Result< BoolGetMembers (const ValueReceiver< const Member & > &members)
 
static MAXON_METHOD const MemberFind (const Id &memberId)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL_DERIVED (Container, MAXON_REFERENCE_NONE, "net.maxon.reflection.interface.container", MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel"))
 

Additional Inherited Members

- Public Types inherited from Member
enum class  KIND {
  PACKAGE ,
  CLASS ,
  FUNCTION ,
  INSTANCE_FUNCTION ,
  CONST_INSTANCE_FUNCTION ,
  CONTAINER_TEST ,
  FUNCTION_TEST
}
 

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL_DERIVED()

MAXON_INTERFACE_NONVIRTUAL_DERIVED ( Container  ,
MAXON_REFERENCE_NONE  ,
"net.maxon.reflection.interface.container"  ,
MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel")   
)
private

◆ GetClasses()

MAXON_METHOD Block<const Class* const> GetClasses ( ) const

Returns a list of all classes which are members of this container. For a Package, these are its top-level classes. For a Class, these are the direct member classes, excluding inherited member classes.

Returns
All classes which are direct members of this container.

◆ FindClass()

MAXON_METHOD const Class* FindClass ( const Id name) const

Finds the class which is a direct member of this container and has the given (unqualified) name. This does not search for inherited member classes of a class.

Parameters
[in]nameName of the class to find.
Returns
The found class, or nullptr if there is no class with the given name.

◆ GetFunctions()

MAXON_METHOD Block<const Function* const> GetFunctions ( ) const

Returns a list of all functions which are members of this container. For a Package, these are its top-level functions. For a Class, these are its member functions, excluding inherited member functions.

Returns
All functions which are direct members of this container.

◆ FindFunction()

MAXON_METHOD Result<const Function*> FindFunction ( const Id name) const

Finds the function which is a direct member of this container and has the given (unqualified) name. If no such function exists, or if the function is overloaded, an error is returned. This does not search for inherited member functions of classes.

Parameters
[in]nameName of the function to find.
Returns
The found function, or an error if no function is found or the function is overloaded.

◆ FindFunctions()

MAXON_METHOD Result<void> FindFunctions ( const Id name,
const ValueReceiver< const Function * > &  result 
) const

Finds all functions which are direct members of this container and have the given (unqualified) name. This does not search for inherited member functions of classes.

Parameters
[in]nameName of the function to find.
[out]resultReceiver for the found functions.
Returns
OK unless a memory allocation failed.

◆ Find()

static const Container* Find ( const Id memberId)
static