wrenbind17::ForeignKlass

wrenbind17::ForeignKlass #

Module: Wrenbind17

A foreign class. #include <foreign.hpp>

Inherited by wrenbind17::ForeignKlassImpl< T >

Public Functions #

Name
ForeignKlass(std::string name)
virtual ~ForeignKlass() =default
ForeignKlass(const ForeignKlass & other)
virtual void generate(std::ostream & os) const =0
ForeignMethod & findFunc(const std::string & name, const bool isStatic)Looks up a foreign function that belongs to this class.
ForeignProp & findProp(const std::string & name, const bool isStatic)Looks up a foreign property that belongs to this class.
WrenForeignMethodFn findSignature(const std::string & signature, const bool isStatic)Finds a function based on the signature.
const std::string & getName() constReturns the name of this foreign class.
WrenForeignClassMethods & getAllocators()Returns a struct with pointers to the allocator and deallocator.

Protected Attributes #

Name
std::string name
std::string ctorDef
std::unordered_map< std::string, std::unique_ptr< ForeignMethod > > methods
std::unordered_map< std::string, std::unique_ptr< ForeignProp > > props
WrenForeignClassMethods allocators

Public Functions Documentation #

function ForeignKlass #

inline ForeignKlass(
    std::string name
)

function ~ForeignKlass #

virtual ~ForeignKlass() =default

function ForeignKlass #

ForeignKlass(
    const ForeignKlass & other
)

function generate #

virtual void generate(
    std::ostream & os
) const =0

Reimplemented by: wrenbind17::ForeignKlassImpl::generate

function findFunc #

inline ForeignMethod & findFunc(
    const std::string & name,
    const bool isStatic
)

Looks up a foreign function that belongs to this class.

function findProp #

inline ForeignProp & findProp(
    const std::string & name,
    const bool isStatic
)

Looks up a foreign property that belongs to this class.

function findSignature #

inline WrenForeignMethodFn findSignature(
    const std::string & signature,
    const bool isStatic
)

Finds a function based on the signature.

function getName #

inline const std::string & getName() const

Returns the name of this foreign class.

function getAllocators #

inline WrenForeignClassMethods & getAllocators()

Returns a struct with pointers to the allocator and deallocator.

Protected Attributes Documentation #

variable name #

std::string name;

variable ctorDef #

std::string ctorDef;

variable methods #

std::unordered_map< std::string, std::unique_ptr< ForeignMethod > > methods;

variable props #

std::unordered_map< std::string, std::unique_ptr< ForeignProp > > props;

variable allocators #

WrenForeignClassMethods allocators;

Updated on 17 October 2023 at 12:26:25 UTC