ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
Array.h File Reference
#include <vector>
Include dependency graph for Array.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ARRAY_DEBUG   0
 
#define ASSERT(x)   { if( !( x ) ) exit(0); }
 
#define Pointer(...)   __VA_ARGS__*
 
#define ConstPointer(...)   const __VA_ARGS__*
 
#define NullPointer(...)   NULL
 
#define FreePointer(...)   { if( __VA_ARGS__ ) free( __VA_ARGS__ ) , __VA_ARGS__ = NULL; }
 
#define AlignedFreePointer(...)   { if( __VA_ARGS__ ) aligned_free( __VA_ARGS__ ) , __VA_ARGS__ = NULL; }
 
#define DeletePointer(...)   { if( __VA_ARGS__ ) delete[] __VA_ARGS__ , __VA_ARGS__ = NULL; }
 

Functions

void * aligned_malloc (size_t size, size_t align)
 
void aligned_free (void *mem)
 
template<class C >
C * NewPointer (size_t size, const char *name=NULL)
 
template<class C >
C * AllocPointer (size_t size, const char *name=NULL)
 
template<class C >
C * AlignedAllocPointer (size_t size, size_t alignment, const char *name=NULL)
 
template<class C >
C * ReAllocPointer (C *c, size_t size, const char *name=NULL)
 
template<class C >
C * PointerAddress (C *c)
 
template<class C >
const C * PointerAddress (const C *c)
 
template<class C >
C * GetPointer (C &c)
 
template<class C >
const C * GetPointer (const C &c)
 
template<class C >
C * GetPointer (std::vector< C > &v)
 
template<class C >
const C * GetPointer (const std::vector< C > &v)
 

Macro Definition Documentation

◆ AlignedFreePointer

#define AlignedFreePointer (   ...)    { if( __VA_ARGS__ ) aligned_free( __VA_ARGS__ ) , __VA_ARGS__ = NULL; }

Definition at line 89 of file Array.h.

◆ ARRAY_DEBUG

#define ARRAY_DEBUG   0

Definition at line 34 of file Array.h.

◆ ASSERT

#define ASSERT (   x)    { if( !( x ) ) exit(0); }

Definition at line 41 of file Array.h.

◆ ConstPointer

#define ConstPointer (   ...)    const __VA_ARGS__*

Definition at line 85 of file Array.h.

◆ DeletePointer

#define DeletePointer (   ...)    { if( __VA_ARGS__ ) delete[] __VA_ARGS__ , __VA_ARGS__ = NULL; }

Definition at line 90 of file Array.h.

◆ FreePointer

#define FreePointer (   ...)    { if( __VA_ARGS__ ) free( __VA_ARGS__ ) , __VA_ARGS__ = NULL; }

Definition at line 88 of file Array.h.

◆ NullPointer

#define NullPointer (   ...)    NULL

Definition at line 86 of file Array.h.

◆ Pointer

#define Pointer (   ...)    __VA_ARGS__*

Definition at line 84 of file Array.h.

Function Documentation

◆ aligned_free()

void aligned_free ( void *  mem)

Definition at line 58 of file Array.h.

◆ aligned_malloc()

void* aligned_malloc ( size_t  size,
size_t  align 
)

Definition at line 46 of file Array.h.

References size.

Referenced by AlignedAllocPointer().

◆ AlignedAllocPointer()

template<class C >
C* AlignedAllocPointer ( size_t  size,
size_t  alignment,
const char *  name = NULL 
)

Definition at line 94 of file Array.h.

References aligned_malloc(), and size.

◆ AllocPointer()

template<class C >
C* AllocPointer ( size_t  size,
const char *  name = NULL 
)

Definition at line 93 of file Array.h.

References size.

◆ GetPointer() [1/4]

template<class C >
C* GetPointer ( C &  c)

Definition at line 101 of file Array.h.

◆ GetPointer() [2/4]

template<class C >
const C* GetPointer ( const C &  c)

Definition at line 102 of file Array.h.

◆ GetPointer() [3/4]

template<class C >
const C* GetPointer ( const std::vector< C > &  v)

Definition at line 104 of file Array.h.

◆ GetPointer() [4/4]

template<class C >
C* GetPointer ( std::vector< C > &  v)

Definition at line 103 of file Array.h.

◆ NewPointer()

template<class C >
C* NewPointer ( size_t  size,
const char *  name = NULL 
)

Definition at line 92 of file Array.h.

References size.

◆ PointerAddress() [1/2]

template<class C >
C* PointerAddress ( C *  c)

Definition at line 99 of file Array.h.

◆ PointerAddress() [2/2]

template<class C >
const C* PointerAddress ( const C *  c)

Definition at line 100 of file Array.h.

◆ ReAllocPointer()

template<class C >
C* ReAllocPointer ( C *  c,
size_t  size,
const char *  name = NULL 
)

Definition at line 95 of file Array.h.

References size.