Menu

object.h

Phillip Kilgore

The object.h header specifies preprocessor macros and a few function prototypes necessary to create a class or interface.

General

This header reserves all symbols beginning with WFCO and wfco. If any such symbols are defined when this header is included, the possibility of a name collision occurs.

Special Tokens

WFCO_DATA

This token serves to denote the data section of a WFCO object.

WFCO_DTOR

This token serves to denote the destructor of a WFCO object.

WFCO_SUPER

This token serves to refer to some aspect of a WFCO object's superclass.

WFCO_SUPER_DATA

Synonymous with WFCO_THIS->WFCO_DATA.WFCO_SUPER.

WFCO_SUPER_VTABLE

Synonymous with WFCO_THIS->WFCO_VTABLE->WFCO_SUPER.

WFCO_THIS

This token serves as the this keywords in object-oriented langauges, except that it does not specify whether or not

WFCO_THIS_DATA

Synonymous with WFCO_THIS->WFCO_DATA

WFCO_THIS_VTABLE

Synonymous with WFCO_THIS->WFCO_VTABLE

WFCO_VTABLE

This token serves to denote the destructor corresponding to a WFCO object.

Calling Conventions

WFCO_SUPER_CALL

usage: WFCO_SUPER_CALL(METHOD, ...)

This macro invokes the superclass method METHOD with the supplied arguments. WFCO_THIS must correspond to a subclass and method must be defined in the superclass.

WFCO_THIS_CALL

usage: WFCO_THIS_CALL(METHOD, ...)

This macro invokes the class method METHOD with the supplied arguments. METHOD must be defined in the class.

WFCO_OBJ_CALL

usage: WFCO_OBJ_CALL(INSTANCE, METHOD, ...)

This method calls the method method on the object instance INSTANCE with the supplied arguments. INSTANCE must contain METHOD.

Authorship

The following macros are defined for the purposes of authoring classes and interfaces.

Method Specification

WFCO_DECLARE_METHOD

usage: WFCO_DECLARE_METHOD(CLASS, METHOD, RETTYPE, ...)

WFCO_DECLARE_ABSTRACT_METHOD

usage: WFCO_DECLARE_ABSTRACT_METHOD(CLASS, METHOD, RETTYPE, ...)

WFCO_METHOD

usage: WFCO_DECLARE_METHOD(CLASS, METHOD, RETTYPE, ...)

Virtual Table Creation

WFCO_DEFINE_VTABLE(CLASS)

WFCO_DEFINE_VTABLE_EX(CLASS, BASE)

WFCO_DEFINE_VTABLE_DD(CLASS)

WFCO_DEFINE_VTABLE_EX_DD(CLASS, BASE)

WFCO_END_VTABLE(CLASS)

WFCO_ATTACH_METHOD(CLASS, METHOD)

WFCO_ABSTRACT_METHOD(METHOD)

Interface Creation

WFCO_INTERFACE

usage: WFCO_INTERFACE(CLASS)

WFCO_INTERFACE_IMPLEMENTS

usage: WFCO_INTERFACE_IMPLEMENTS(CLASS,BASE)

WFCO_END_INTERFACE

usage: WFCO_END_INTERFACE(CLASS)

Class Creation

WFCO_CLASS(CLASSNAME)

WFCO_CLASS_EXTENDS(CLASSNAME)

WFCO_METHODS(CLASSNAME)

WFCO_IMPLEMENTS(CLASSNAME,BASE)

WFCO_END_CLASS(CLASSNAME)


Related

Wiki: Home
Wiki: Interface

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.