Desktop/FinalOpenEaagles/FinalOpenEaagles/basic/macros.h File Reference

This graph shows which files directly or indirectly include this file:


Defines

#define DECLARE_SUBCLASS(ThisType, BaseType)
#define IMPLEMENT_SUBCLASS(ThisType, FORMNAME)
#define IMPLEMENT_PARTIAL_SUBCLASS(ThisType, FORMNAME)
#define IMPLEMENT_ABSTRACT_SUBCLASS(ThisType, FORMNAME)
#define EMPTY_SLOTTABLE(ThisType)
#define IMPLEMENT_EMPTY_SLOTTABLE_SUBCLASS(ThisType, FORMNAME)
#define EMPTY_COPYDATA(ThisType)
#define EMPTY_DELETEDATA(ThisType)
#define EMPTY_SERIALIZER(ThisType)
#define SET_SLOTTABLE   slotTable = &slottable;
#define BEGIN_SLOTTABLE(ThisType)   const char* ThisType::slots[] = {
#define END_SLOTTABLE(ThisType)
#define BEGIN_SLOT_MAP(ThisType)
#define END_SLOT_MAP()
#define ON_SLOT(idx, setFunc, ObjType)
#define BEGIN_EVENT_HANDLER(ThisType)
#define END_EVENT_HANDLER()
#define ON_EVENT_OBJ(token, onEvent, ObjType)
#define ON_EVENT(token, onEvent)
#define ON_ANYKEY_OBJ(onEvent, ObjType)
#define ON_ANYKEY(onEvent)

Define Documentation

#define BEGIN_EVENT_HANDLER ( ThisType   ) 

Value:

bool ThisType::event(const int _event, Eaagles::Basic::LcObject* const _obj)       \
    {                                                                                  \
        bool _used = false;
BEGIN_EVENT_HANDLER() -- Standard event() beginning.

#define BEGIN_SLOT_MAP ( ThisType   ) 

Value:

bool ThisType::setSlotByIndex(const int slotindex, Eaagles::Basic::LcObject* const obj)  \
    {                                                                                  \
        const int _n = BaseClass::getSlotTable().n();                                  \
        if (slotindex <= _n) {                                                         \
            return BaseClass::setSlotByIndex(slotindex,obj);                           \
        }                                                                              \
        bool _ok = false;                                                              \
        int _n1 = (slotindex - _n);
BEGIN_SLOT_MAP() -- Standard setSlotByIndex() beginning.

#define BEGIN_SLOTTABLE ( ThisType   )     const char* ThisType::slots[] = {

BEGIN_SLOTTABLE() -- Standard SlotTable beginning.

#define DECLARE_SUBCLASS ( ThisType,
BaseType   ) 

Value:

typedef BaseType BaseClass;                                                                       \
    public: ThisType(const ThisType& org);                                                            \
    public: virtual ~ThisType();                                                                      \
    public: virtual Eaagles::Basic::LcObject* clone() const;                                          \
    public: ThisType& operator=(const ThisType& org);                                                 \
    protected: void copyData(const ThisType& org, const bool cc = false);                             \
    protected: void deleteData();                                                                     \
    public: virtual bool isClassType(const std::type_info& type) const;                               \
    private: static const char* fname;                                                                \
    public: static const char* getFormName();                                                         \
    public: virtual const char* formName() const;                                                     \
    public: virtual bool isFormName(const char name[]) const;                                         \
    public: static const Eaagles::Basic::LcSlotTable& getSlotTable();                                 \
    protected: virtual bool setSlotByIndex(const int slotindex, Eaagles::Basic::LcObject* const obj); \
    protected: virtual Eaagles::Basic::LcObject* getSlotByIndex(const int slotindex);                 \
    protected: static const Eaagles::Basic::LcSlotTable slottable;                                    \
    private: static const char* slots[];                                                              \
    private: static const int nslots;                                                                 \
    public: virtual std::ostream&                                                                     \
    serialize(std::ostream& sout, const int i = 0, const bool slotsOnly = false) const;                   \
    private:
Macro to set up class declaration (declares all required functions - Note: Defines 'BaseClass')

#define EMPTY_COPYDATA ( ThisType   ) 

Value:

void ThisType::copyData(const ThisType& org, const bool)                           \
    {                                                                                  \
        BaseClass::copyData(org,false);                                                \
    }
EMPTY_COPYDATA() -- Creates an empty copy data function.

#define EMPTY_DELETEDATA ( ThisType   ) 

Value:

void ThisType::deleteData()                                                        \
    {                                                                                  \
        BaseClass::deleteData();                                                       \
    }
EMPTY_DELETEDATA() -- Creates an empty delete data function.

#define EMPTY_SERIALIZER ( ThisType   ) 

Value:

std::ostream& ThisType::serialize(                                                 \
    std::ostream& sout, const int i, const bool slotsOnly) const                       \
    {                                                                                  \
        int j = 0;                                                                     \
        if ( !slotsOnly ) {                                                            \
            sout << "( " << fname << std::endl;                                        \
            j = 4;                                                                     \
        }                                                                              \
        BaseClass::serialize(sout,i+j,true);                                           \
        if ( !slotsOnly ) {                                                            \
            indent(sout,i);                                                            \
            sout << ")" << std::endl;                                                  \
        }                                                                              \
        return sout;                                                                   \
    }
EMPTY_SERIALIZER() -- Creates an empty serialize function.

#define EMPTY_SLOTTABLE ( ThisType   ) 

Value:

const char* ThisType::slots[] = { "" };                                            \
    const int ThisType::nslots = 0;                                                    \
    const Eaagles::Basic::LcSlotTable ThisType::slottable(0, 0, BaseClass::getSlotTable());  \
    bool ThisType::setSlotByIndex(const int si, Eaagles::Basic::LcObject* const obj)         \
    {                                                                                  \
        return BaseClass::setSlotByIndex(si,obj);                                      \
    }                                                                                  \
    Eaagles::Basic::LcObject* ThisType::getSlotByIndex(const int si)                   \
    {                                                                                  \
        return BaseClass::getSlotByIndex(si);                                          \
    }
EMPTY_SLOTTABLE() -- Generates an empty slottable.

 
#define END_EVENT_HANDLER (  ) 

Value:

if (!_used) _used = BaseClass::event(_event,_obj);                             \
        return _used;                                                                  \
    }
END_EVENT_HANDLER() -- Standard event() ending.

 
#define END_SLOT_MAP (  ) 

Value:

return _ok;                                                                    \
    }
END_SLOT_MAP() -- Standard setSlotByIndex() ending.

#define END_SLOTTABLE ( ThisType   ) 

Value:

};                                                                                 \
    const int ThisType::nslots = (sizeof(slots)/sizeof(char*));                        \
    const Eaagles::Basic::LcSlotTable ThisType::slottable(ThisType::slots, ThisType::nslots, \
                                               ThisType::BaseClass::getSlotTable());
END_SLOTTABLE() -- Standard SlotTable ending.

#define IMPLEMENT_ABSTRACT_SUBCLASS ( ThisType,
FORMNAME   ) 

Macro to set up abstract class implementation Same as IMPLEMENT_SUBCLASS() except that the clone function always returns a zero(0).

#define IMPLEMENT_EMPTY_SLOTTABLE_SUBCLASS ( ThisType,
FORMNAME   ) 

Value:

IMPLEMENT_SUBCLASS(ThisType,FORMNAME)                                              \
    EMPTY_SLOTTABLE(ThisType)
IMPLEMENT_EMPTY_SLOTTABLE_SUBCLASS() --.

#define IMPLEMENT_PARTIAL_SUBCLASS ( ThisType,
FORMNAME   ) 

Value:

const char* ThisType::fname = FORMNAME;                                            \
    const char* ThisType::formName() const { return fname; }                           \
    const char* ThisType::getFormName() { return fname; }                              \
    bool ThisType::isFormName(const char name[]) const                                \
    {                                                                                  \
        if (name == 0) return false;                                                   \
        if ( strcmp(fname,name) == 0 )  return true;                                   \
        else return ThisType::BaseClass::isFormName(name);                             \
    }                                                                                  \
    const Eaagles::Basic::LcSlotTable& ThisType::getSlotTable() { return slottable; }  \
    bool ThisType::isClassType(const std::type_info& type) const                       \
    {                                                                                  \
        if ( type == typeid(ThisType) ) return true;                                   \
        else return ThisType::BaseClass::isClassType(type);                            \
    }
Same as IMPLEMENT_SUBCLASS() except that it does not define the constructors, destructor, copy operator or clone functions.

#define IMPLEMENT_SUBCLASS ( ThisType,
FORMNAME   ) 

Macro to set up class implementation (defines defaults for all required functions)

#define ON_ANYKEY ( onEvent   ) 

Value:

if (!_used && _event <= MAX_KEY_EVENT) {                                           \
        _used = onEvent(_event);                                                       \
    }
ON_ANYKEY -- Handle any keyboard input.

#define ON_ANYKEY_OBJ ( onEvent,
ObjType   ) 

Value:

if (!_used && _event <= MAX_KEY_EVENT && dynamic_cast<ObjType*>(_obj) != 0) {      \
        _used = onEvent(_event,((ObjType*)_obj));                                      \
    }
ON_ANYKEY_OBJ -- Handle any keyboard input with an object.

#define ON_EVENT ( token,
onEvent   ) 

Value:

if (!_used && token == _event) {                                                   \
        _used = onEvent();                                                             \
    }
ON_EVENT -- Handle events without an object.

#define ON_EVENT_OBJ ( token,
onEvent,
ObjType   ) 

Value:

if (!_used && token == _event && dynamic_cast<ObjType*>(_obj) != 0) {              \
        _used = onEvent((ObjType*)_obj);                                               \
    }
ON_EVENT_OBJ -- Handle events with an object.

#define ON_SLOT ( idx,
setFunc,
ObjType   ) 

Value:

if ( !_ok ) {                                                                      \
        ObjType* _msg = dynamic_cast<ObjType*>(obj);                                   \
        if (idx == _n1 && _msg != 0) {                                                 \
            _ok = setFunc(_msg);                                                       \
        }                                                                              \
    }
ON_SLOT -- Handle slots.

#define SET_SLOTTABLE   slotTable = &slottable;

Used by constructors to setup slotTable data.


Generated on Tue Dec 19 16:22:17 2006 for Eaagles by  doxygen 1.5.0