Open Search
    Class Class Reference

    #include <reflectionbase.h>

    Inheritance diagram for Class:

    Detailed Description

    Class represents a C++ class. It may contain member functions and member classes. Also if the class is an interface (in the sense of the Maxon API), the corresponding interface information can be obtained from Class.

    Public Member Functions

    MAXON_METHOD const InterfaceReference * GetInterface () const
     
    MAXON_METHOD const NonvirtualInterfaceReference * GetNonvirtualInterface () const
     
    MAXON_METHOD const DataTypeGetType () const
     
    MAXON_METHOD Block< const Class *const > GetBaseClasses () const
     
    MAXON_METHOD const ClassGetStaticInterface () const
     
    - Public Member Functions inherited from Container
    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 ClassFind (const Id &memberId)
     
    template<typename INTERFACE >
    static const ClassFindInterface ()
     
    static const ClassFindInterface (const NonvirtualInterfaceReference *i)
     
    static const ClassFindInterface (const InterfaceReference *i)
     
    - Static Public Member Functions inherited from Container
    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 (Class, MAXON_REFERENCE_NONE, "net.maxon.reflection.interface.class", 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 ( Class  ,
    MAXON_REFERENCE_NONE  ,
    "net.maxon.reflection.interface.class"  ,
    MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel")   
    )
    private

    ◆ GetInterface()

    MAXON_METHOD const InterfaceReference* GetInterface ( ) const

    Returns a corresponding InterfaceReference if this Class is virtual interface, otherwise nullptr. If the interface has static methods, also GetNonvirtualInterface() returns a valid pointer which points to the NonvirtualInterfaceReference for the static methods.

    Returns
    A InterfaceReference for this Class, or nullptr if this is no virtual interface.

    ◆ GetNonvirtualInterface()

    MAXON_METHOD const NonvirtualInterfaceReference* GetNonvirtualInterface ( ) const

    Returns a corresponding NonvirtualInterfaceReference if this Class is a non-virtual interface, or if this Class is a virtual interface with static methods. otherwise nullptr.

    Returns
    An NonvirtualInterfaceReference for this Class, or nullptr if there is no corresponding non-virtual interface.

    ◆ GetType()

    MAXON_METHOD const DataType& GetType ( ) const

    Returns the DataType of this Class if available. Virtual or non-virtual interfaces are guaranteed to have a DataType, for other classes a corresponding MAXON_DATATYPE needs to exist.

    Returns
    Data type of this Class, may be null.

    ◆ GetBaseClasses()

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

    TODO: (Ole) Not yet supported.

    ◆ GetStaticInterface()

    MAXON_METHOD const Class* GetStaticInterface ( ) const

    Return a Class containing the static methods of this virtual interface, or nullptr is this Class isn't a virtual interface or has no static methods.

    Returns
    The Class for the static methods of this virtual interface, or nullptr.

    ◆ Find()

    static const Class* Find ( const Id memberId)
    static

    Finds the class whose id is memberId. The id is the qualified name of the class with dot as separator, see Member::GetId(). If there is no class with the given memberId, nullptr is returned.

    Parameters
    [in]memberIdA member id for a class.
    Returns
    The class with the given memberId, or nullptr.

    ◆ FindInterface() [1/3]

    static const Class* FindInterface ( )
    static

    Finds the Class object for a given non-virtual or virtual interface.

    Template Parameters
    INTERFACEThe interface class (such as StringInterface).
    Returns
    The Class object for the given interface, or nullptr if no reflection was registered for that interface.

    ◆ FindInterface() [2/3]

    static const Class* FindInterface ( const NonvirtualInterfaceReference *  i)
    static

    Finds the Class object for a given non-virtual interface reference.

    Parameters
    [in]iThe interface.
    Returns
    The Class object for the given interface, or nullptr if no reflection was registered for that interface or i was nullptr.

    ◆ FindInterface() [3/3]

    static const Class* FindInterface ( const InterfaceReference *  i)
    static

    Finds the Class object for a given virtual interface reference.

    Parameters
    [in]iThe interface.
    Returns
    The Class object for the given interface, or nullptr if no reflection was registered for that interface or i was nullptr.