CrystalMacros.h File Reference

#include "CrystalIDs.h"
#include "ICrystalCriticalSection.h"
#include "ICrystalServices.h"
#include "CrystalObject/CrystalObject.h"
#include "Services.h"
#include "Extends.h"
#include "Module.h"
#include "CrystalDebug/CrystalDebug.h"
#include "CrystalNew/CrystalNew.h"
#include "CrystalLock.h"
#include "CrystalLockLite.h"
#include "CrystalBaseTime.h"
#include "CrystalCPU.h"
#include "CrystalTemplates.h"
#include "CrystalBaseFunctions/CrystalBaseFunctions.h"
#include "Array.h"
#include "LiteArray/LiteArray.h"
#include "ConstString/ConstString.h"
#include "CrystalErrors.h"
#include "CrystalGUIDs.h"
#include "CrystalFourCCs.h"
#include "CrystalComplexTypes.h"
#include "WrapString.h"

Go to the source code of this file.

Defines

#define FreeObjectInterface(pObject)
#define GetObjectInterface(pDestObject, pSourceObject)
#define CR_ALLOC(size)   this->m_pCrystal->AllocMem(size)
#define CR_ALLOCARRAY(type, num)   (type *)CR_ALLOC(sizeof(type)*(num))
#define CR_ALLOCELEMENT(type)   CR_ALLOCARRAY(type, 1)
#define CR_FREE(pointer)   { this->m_pCrystal->FreeMem(pointer); (pointer) = NULL; }
#define CR_REALLOC(pointer, size)   this->m_pCrystal->ReallocMem((pointer), (size))
#define CR_REALLOCARRAY(pointer, type, size)   (type *)CR_REALLOC(pointer, (size)*sizeof(type))
#define CR_DELETEARRAY(array)
#define CR_DELETEELEMENT(element)
#define CR_ZERO(pointer, size)   m_pCrystal->FillData(pointer, size, 0)
#define CR_ZEROARRAY(pointer, num)   CR_ZERO(pointer, sizeof((pointer)[0])*(num))
#define CR_ZEROSTRUCT(pointer)   CR_ZERO(pointer, sizeof((pointer)[0]))
#define CR_INITSTRUCT(pointer, varsize)   { CR_ZEROSTRUCT(pointer); (pointer)->varsize = sizeof((pointer)[0]); }
#define CR_SYNCHRONIZED   CLock lock(this->m_pCS);
#define CR_SYNCHRONIZED_HOLE   CLockHole lockHole(lock);
#define CR_SYNCHRONIZED_NAKEDHOLE   CNakedLockHole nakedLockHole(this->m_pCS);
#define CR_QUERY(Interface)   if (id == ID_##Interface) result = static_cast<Interface *>(this)
#define CR_QUERY1(Interface, Parent)   if (id == ID_##Interface) result = static_cast<Interface *>(static_cast<Parent *>(this))
#define CR_QUERY2(Interface, Parent1, Parent2)   if (id == ID_##Interface) result = static_cast<Interface *>(static_cast<Parent1 *>(static_cast<Parent2 *>(this)))
#define CR_QUERY_ICrystalObject   if (id == ID_ICrystalObject) result = (ICrystalObject *)(void *)(this);
#define CR_QUERY_COM_INTERFACE


Define Documentation

#define CR_ALLOC size   )     this->m_pCrystal->AllocMem(size)
 

Operating with data (dynamic allocation).

Definition at line 39 of file CrystalMacros.h.

#define CR_ALLOCARRAY type,
num   )     (type *)CR_ALLOC(sizeof(type)*(num))
 

Definition at line 40 of file CrystalMacros.h.

#define CR_ALLOCELEMENT type   )     CR_ALLOCARRAY(type, 1)
 

Definition at line 41 of file CrystalMacros.h.

#define CR_DELETEARRAY array   ) 
 

Value:

{ \
    delete[] array; \
    (array) = NULL; \
}

Definition at line 46 of file CrystalMacros.h.

#define CR_DELETEELEMENT element   ) 
 

Value:

{ \
    delete (element); \
    (element) = NULL; \
}

Definition at line 50 of file CrystalMacros.h.

#define CR_FREE pointer   )     { this->m_pCrystal->FreeMem(pointer); (pointer) = NULL; }
 

Definition at line 42 of file CrystalMacros.h.

#define CR_INITSTRUCT pointer,
varsize   )     { CR_ZEROSTRUCT(pointer); (pointer)->varsize = sizeof((pointer)[0]); }
 

Definition at line 59 of file CrystalMacros.h.

#define CR_QUERY Interface   )     if (id == ID_##Interface) result = static_cast<Interface *>(this)
 

Definition at line 72 of file CrystalMacros.h.

#define CR_QUERY1 Interface,
Parent   )     if (id == ID_##Interface) result = static_cast<Interface *>(static_cast<Parent *>(this))
 

Definition at line 73 of file CrystalMacros.h.

#define CR_QUERY2 Interface,
Parent1,
Parent2   )     if (id == ID_##Interface) result = static_cast<Interface *>(static_cast<Parent1 *>(static_cast<Parent2 *>(this)))
 

Definition at line 74 of file CrystalMacros.h.

#define CR_QUERY_COM_INTERFACE
 

Value:

CVT PVOID CCT QueryCOMInterface(SGUID guid) { \
        PVOID result = NULL; \
        QueryInterface(*(GUID *)&guid, &result); \
        return result; \
    }

Definition at line 78 of file CrystalMacros.h.

#define CR_QUERY_ICrystalObject   if (id == ID_ICrystalObject) result = (ICrystalObject *)(void *)(this);
 

Definition at line 76 of file CrystalMacros.h.

#define CR_REALLOC pointer,
size   )     this->m_pCrystal->ReallocMem((pointer), (size))
 

Definition at line 43 of file CrystalMacros.h.

#define CR_REALLOCARRAY pointer,
type,
size   )     (type *)CR_REALLOC(pointer, (size)*sizeof(type))
 

Definition at line 44 of file CrystalMacros.h.

#define CR_SYNCHRONIZED   CLock lock(this->m_pCS);
 

Definition at line 66 of file CrystalMacros.h.

#define CR_SYNCHRONIZED_HOLE   CLockHole lockHole(lock);
 

Definition at line 67 of file CrystalMacros.h.

#define CR_SYNCHRONIZED_NAKEDHOLE   CNakedLockHole nakedLockHole(this->m_pCS);
 

Definition at line 68 of file CrystalMacros.h.

#define CR_ZERO pointer,
size   )     m_pCrystal->FillData(pointer, size, 0)
 

Initializing data.

Definition at line 56 of file CrystalMacros.h.

#define CR_ZEROARRAY pointer,
num   )     CR_ZERO(pointer, sizeof((pointer)[0])*(num))
 

Definition at line 57 of file CrystalMacros.h.

#define CR_ZEROSTRUCT pointer   )     CR_ZERO(pointer, sizeof((pointer)[0]))
 

Definition at line 58 of file CrystalMacros.h.

#define FreeObjectInterface pObject   ) 
 

Value:

{ \
    if ((pObject) != NULL) { \
        GetBasis(pObject)->Release(); \
        (pObject) = NULL; \
    } \
}
Releases ICrystalObject-based Interface variable.

Definition at line 23 of file CrystalMacros.h.

#define GetObjectInterface pDestObject,
pSourceObject   ) 
 

Value:

{ \
    (pDestObject) = (pSourceObject); \
    if ((pDestObject) != NULL) { \
        GetBasis(pDestObject)->AddRef(); \
    } \
}
Copies ICrystalObject-based Interface.

Definition at line 31 of file CrystalMacros.h.


Generated on Wed Dec 21 18:10:14 2005 for Crystal2 Platform by  doxygen 1.4.5