Macros | Functions
IceMemoryMacros.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CHECKALLOC(x)   if(!x) return false;
 
#define DELETEARRAY(x)   if (x) { delete []x; x = null; }
 Deletes an array. More...
 
#define DELETESINGLE(x)   if (x) { delete x; x = null; }
 Deletes an instance of a class. More...
 
#define SAFE_ALLOC(ptr, type, count)   DELETEARRAY(ptr); ptr = new type[count]; CHECKALLOC(ptr);
 Standard allocation cycle. More...
 
#define SAFE_DESTRUCT(x)   if (x) { (x)->SelfDestruct(); (x) = null; }
 Safe ICE-style release. More...
 
#define SAFE_RELEASE(x)   if (x) { (x)->Release(); (x) = null; }
 Safe D3D-style release. More...
 
#define SIZEOFOBJECT   sizeof(*this)
 Gives the size of current object. Avoid some mistakes (e.g. "sizeof(this)"). More...
 

Functions

inline_ void CopyMemory (void *dest, const void *src, udword size)
 
inline_ void FillMemory (void *dest, udword size, ubyte val)
 
inline_ void MoveMemory (void *dest, const void *src, udword size)
 
inline_ void StoreDwords (udword *dest, udword nb, udword value)
 
inline_ void ZeroMemory (void *addr, udword size)
 

Detailed Description

Contains all memory macros.

Author
Pierre Terdiman
Date
April, 4, 2000

Definition in file IceMemoryMacros.h.

Macro Definition Documentation

#define CHECKALLOC (   x)    if(!x) return false;

Definition at line 103 of file IceMemoryMacros.h.

#define DELETEARRAY (   x)    if (x) { delete []x; x = null; }

Deletes an array.

Definition at line 96 of file IceMemoryMacros.h.

#define DELETESINGLE (   x)    if (x) { delete x; x = null; }

Deletes an instance of a class.

Definition at line 95 of file IceMemoryMacros.h.

#define SAFE_ALLOC (   ptr,
  type,
  count 
)    DELETEARRAY(ptr); ptr = new type[count]; CHECKALLOC(ptr);

Standard allocation cycle.

Definition at line 107 of file IceMemoryMacros.h.

#define SAFE_DESTRUCT (   x)    if (x) { (x)->SelfDestruct(); (x) = null; }

Safe ICE-style release.

Definition at line 98 of file IceMemoryMacros.h.

#define SAFE_RELEASE (   x)    if (x) { (x)->Release(); (x) = null; }

Safe D3D-style release.

Definition at line 97 of file IceMemoryMacros.h.

#define SIZEOFOBJECT   sizeof(*this)

Gives the size of current object. Avoid some mistakes (e.g. "sizeof(this)").

Definition at line 93 of file IceMemoryMacros.h.

Function Documentation

inline_ void CopyMemory ( void dest,
const void src,
udword  size 
)

Copies a buffer.

Parameters
addr[in] destination buffer address
addr[in] source buffer address
size[in] buffer length
See also
ZeroMemory
FillMemory
StoreDwords
MoveMemory

Definition at line 81 of file IceMemoryMacros.h.

inline_ void FillMemory ( void dest,
udword  size,
ubyte  val 
)

Fills a buffer with a given byte.

Parameters
addr[in] buffer address
size[in] buffer length
val[in] the byte value
See also
StoreDwords
ZeroMemory
CopyMemory
MoveMemory

Definition at line 37 of file IceMemoryMacros.h.

inline_ void MoveMemory ( void dest,
const void src,
udword  size 
)

Moves a buffer.

Parameters
addr[in] destination buffer address
addr[in] source buffer address
size[in] buffer length
See also
ZeroMemory
FillMemory
StoreDwords
CopyMemory

Definition at line 91 of file IceMemoryMacros.h.

inline_ void StoreDwords ( udword dest,
udword  nb,
udword  value 
)

Fills a buffer with a given dword.

Parameters
addr[in] buffer address
nb[in] number of dwords to write
value[in] the dword value
See also
FillMemory
ZeroMemory
CopyMemory
MoveMemory
Warning
writes nb*4 bytes !

Definition at line 48 of file IceMemoryMacros.h.

inline_ void ZeroMemory ( void addr,
udword  size 
)

Clears a buffer.

Parameters
addr[in] buffer address
size[in] buffer length
See also
FillMemory
StoreDwords
CopyMemory
MoveMemory

Definition at line 27 of file IceMemoryMacros.h.



openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat Apr 13 2019 02:14:26