- Main Page
- Classes
- Files
- Directories
- Examples

- File List
- File Members

Classes | Defines | Functions

# fbxnew.h File Reference

New operator override templates. More...

`#include <fbxsdk/fbxsdk_def.h>`
`#include <new>`
`#include <fbxsdk/fbxsdk_nsbegin.h>`
`#include <fbxsdk/fbxsdk_nsend.h>`

Go to the source code of this file.

## Classes
struct | FbxSimpleType< T >
struct | FbxSimpleType< T * >
struct | FbxSimpleType< const T >
struct | FbxSimpleType< T[n]>
## Defines
#define | FBXSDK_DEFINE_SIMPLE_TYPE(T) template<> struct FbxSimpleType<T>{ union {T t;} catcherr; enum {value = 1};}
#define | FBXSDK_IS_SIMPLE_TYPE(T) ((bool)FbxSimpleType<T>::value)
#define | FBXSDK_FRIEND_NEW()
## Functions
| FBXSDK_DEFINE_SIMPLE_TYPE (bool)
| FBXSDK_DEFINE_SIMPLE_TYPE (char)
| FBXSDK_DEFINE_SIMPLE_TYPE (unsigned char)
| FBXSDK_DEFINE_SIMPLE_TYPE (short)
| FBXSDK_DEFINE_SIMPLE_TYPE (int)
| FBXSDK_DEFINE_SIMPLE_TYPE (long)
| FBXSDK_DEFINE_SIMPLE_TYPE (float)
| FBXSDK_DEFINE_SIMPLE_TYPE (double)
| FBXSDK_DEFINE_SIMPLE_TYPE (unsigned long long)
template<typename T >
T * | FbxNew ()
template<typename T , typename T1 >
T * | FbxNew (T1 &p1)
template<typename T , typename T1 >
T * | FbxNew (const T1 &p1)
template<typename T , typename T1 , typename T2 >
T * | FbxNew (T1 &p1, T2 &p2)
template<typename T , typename T1 , typename T2 >
T * | FbxNew (T1 &p1, const T2 &p2)
template<typename T , typename T1 , typename T2 >
T * | FbxNew (const T1 &p1, T2 &p2)
template<typename T , typename T1 , typename T2 >
T * | FbxNew (const T1 &p1, const T2 &p2)
template<typename T , typename T1 , typename T2 , typename T3 >
T * | FbxNew (T1 &p1, T2 &p2, T3 &p3)
template<typename T , typename T1 , typename T2 , typename T3 >
T * | FbxNew (T1 &p1, T2 &p2, const T3 &p3)
template<typename T , typename T1 , typename T2 , typename T3 >
T * | FbxNew (T1 &p1, const T2 &p2, T3 &p3)
template<typename T , typename T1 , typename T2 , typename T3 >
T * | FbxNew (T1 &p1, const T2 &p2, const T3 &p3)
template<typename T , typename T1 , typename T2 , typename T3 >
T * | FbxNew (const T1 &p1, T2 &p2, T3 &p3)
template<typename T , typename T1 , typename T2 , typename T3 >
T * | FbxNew (const T1 &p1, T2 &p2, const T3 &p3)
template<typename T , typename T1 , typename T2 , typename T3 >
T * | FbxNew (const T1 &p1, const T2 &p2, T3 &p3)
template<typename T , typename T1 , typename T2 , typename T3 >
T * | FbxNew (const T1 &p1, const T2 &p2, const T3 &p3)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * | FbxNew (T1 &p1, T2 &p2, T3 &p3, T4 &p4)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * | FbxNew (T1 &p1, T2 &p2, T3 &p3, const T4 &p4)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * | FbxNew (T1 &p1, T2 &p2, const T3 &p3, T4 &p4)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * | FbxNew (T1 &p1, T2 &p2, const T3 &p3, const T4 &p4)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * | FbxNew (T1 &p1, const T2 &p2, T3 &p3, T4 &p4)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * | FbxNew (T1 &p1, const T2 &p2, T3 &p3, const T4 &p4)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * | FbxNew (T1 &p1, const T2 &p2, const T3 &p3, T4 &p4)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * | FbxNew (T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * | FbxNew (const T1 &p1, T2 &p2, T3 &p3, T4 &p4)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * | FbxNew (const T1 &p1, T2 &p2, T3 &p3, const T4 &p4)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * | FbxNew (const T1 &p1, T2 &p2, const T3 &p3, T4 &p4)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * | FbxNew (const T1 &p1, T2 &p2, const T3 &p3, const T4 &p4)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * | FbxNew (const T1 &p1, const T2 &p2, T3 &p3, T4 &p4)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * | FbxNew (const T1 &p1, const T2 &p2, T3 &p3, const T4 &p4)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * | FbxNew (const T1 &p1, const T2 &p2, const T3 &p3, T4 &p4)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * | FbxNew (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
T * | FbxNew (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
T * | FbxNew (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 >
T * | FbxNew (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 >
T * | FbxNew (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8)
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 >
T * | FbxNew (const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9)
template<typename T >
void | FbxDelete (T *p)
template<typename T >
void | FbxDelete (const T *p)
template<typename T >
T * | FbxNewArray (int n)
template<typename T >
void | FbxDeleteArray (T *p)

## Detailed Description

New operator override templates.

Instead of overloading the operator new in the FBX SDK, we provide a set of templates that are used internally to create objects. This mechanic allows the FBX SDK to call a different memory allocator.

See also:
  FbxSetMallocHandler FbxSetCallocHandler FbxSetReallocHandler FbxSetFreeHandler FbxSetMSizeHandler

Definition in file fbxnew.h.

## Define Documentation

#define FBXSDK_DEFINE_SIMPLE_TYPE | ( |  | T | ) | template<> struct FbxSimpleType<T>{ union {T t;} catcherr; enum {value = 1};}

Search for all occurrences

Definition at line 40 of file fbxnew.h.

#define FBXSDK_IS_SIMPLE_TYPE | ( |  | T | ) | ((bool)FbxSimpleType<T>::value)

Search for all occurrences

Definition at line 57 of file fbxnew.h.

#define FBXSDK_FRIEND_NEW | ( |  | ) |

Search for all occurrences

Definition at line 327 of file fbxnew.h.

## Function Documentation

FBXSDK_DEFINE_SIMPLE_TYPE | ( | bool |  | ) |

Search for all occurrences

FBXSDK_DEFINE_SIMPLE_TYPE | ( | char |  | ) |

Search for all occurrences

FBXSDK_DEFINE_SIMPLE_TYPE | ( | unsigned | char | ) |

Search for all occurrences

FBXSDK_DEFINE_SIMPLE_TYPE | ( | short |  | ) |

Search for all occurrences

FBXSDK_DEFINE_SIMPLE_TYPE | ( | int |  | ) |

Search for all occurrences

FBXSDK_DEFINE_SIMPLE_TYPE | ( | long |  | ) |

Search for all occurrences

FBXSDK_DEFINE_SIMPLE_TYPE | ( | float |  | ) |

Search for all occurrences

FBXSDK_DEFINE_SIMPLE_TYPE | ( | double |  | ) |

Search for all occurrences

FBXSDK_DEFINE_SIMPLE_TYPE | ( | unsigned long | long | ) |

Search for all occurrences

T* FbxNew | ( |  | ) |

Search for all occurrences

Definition at line 59 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T();
    }

T* FbxNew | ( | T1 & | p1 | ) |

Search for all occurrences

Definition at line 65 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1);
    }

T* FbxNew | ( | const T1 & | p1 | ) |

Search for all occurrences

Definition at line 71 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1);
    }

T* FbxNew | ( | T1 & | p1,
|  | T2 & | p2
| ) |  |

Search for all occurrences

Definition at line 77 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2);
    }

T* FbxNew | ( | T1 & | p1,
|  | const T2 & | p2
| ) |  |

Search for all occurrences

Definition at line 83 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2);
    }

T* FbxNew | ( | const T1 & | p1,
|  | T2 & | p2
| ) |  |

Search for all occurrences

Definition at line 89 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2);
    }

T* FbxNew | ( | const T1 & | p1,
|  | const T2 & | p2
| ) |  |

Search for all occurrences

Definition at line 95 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2);
    }

T* FbxNew | ( | T1 & | p1,
|  | T2 & | p2,
|  | T3 & | p3
| ) |  |

Search for all occurrences

Definition at line 101 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3);
    }

T* FbxNew | ( | T1 & | p1,
|  | T2 & | p2,
|  | const T3 & | p3
| ) |  |

Search for all occurrences

Definition at line 107 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3);
    }

T* FbxNew | ( | T1 & | p1,
|  | const T2 & | p2,
|  | T3 & | p3
| ) |  |

Search for all occurrences

Definition at line 113 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3);
    }

T* FbxNew | ( | T1 & | p1,
|  | const T2 & | p2,
|  | const T3 & | p3
| ) |  |

Search for all occurrences

Definition at line 119 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3);
    }

T* FbxNew | ( | const T1 & | p1,
|  | T2 & | p2,
|  | T3 & | p3
| ) |  |

Search for all occurrences

Definition at line 125 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3);
    }

T* FbxNew | ( | const T1 & | p1,
|  | T2 & | p2,
|  | const T3 & | p3
| ) |  |

Search for all occurrences

Definition at line 131 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3);
    }

T* FbxNew | ( | const T1 & | p1,
|  | const T2 & | p2,
|  | T3 & | p3
| ) |  |

Search for all occurrences

Definition at line 137 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3);
    }

T* FbxNew | ( | const T1 & | p1,
|  | const T2 & | p2,
|  | const T3 & | p3
| ) |  |

Search for all occurrences

Definition at line 143 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3);
    }

T* FbxNew | ( | T1 & | p1,
|  | T2 & | p2,
|  | T3 & | p3,
|  | T4 & | p4
| ) |  |

Search for all occurrences

Definition at line 149 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3, p4);
    }

T* FbxNew | ( | T1 & | p1,
|  | T2 & | p2,
|  | T3 & | p3,
|  | const T4 & | p4
| ) |  |

Search for all occurrences

Definition at line 155 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3, p4);
    }

T* FbxNew | ( | T1 & | p1,
|  | T2 & | p2,
|  | const T3 & | p3,
|  | T4 & | p4
| ) |  |

Search for all occurrences

Definition at line 161 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3, p4);
    }

T* FbxNew | ( | T1 & | p1,
|  | T2 & | p2,
|  | const T3 & | p3,
|  | const T4 & | p4
| ) |  |

Search for all occurrences

Definition at line 167 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3, p4);
    }

T* FbxNew | ( | T1 & | p1,
|  | const T2 & | p2,
|  | T3 & | p3,
|  | T4 & | p4
| ) |  |

Search for all occurrences

Definition at line 173 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3, p4);
    }

T* FbxNew | ( | T1 & | p1,
|  | const T2 & | p2,
|  | T3 & | p3,
|  | const T4 & | p4
| ) |  |

Search for all occurrences

Definition at line 179 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3, p4);
    }

T* FbxNew | ( | T1 & | p1,
|  | const T2 & | p2,
|  | const T3 & | p3,
|  | T4 & | p4
| ) |  |

Search for all occurrences

Definition at line 185 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3, p4);
    }

T* FbxNew | ( | T1 & | p1,
|  | const T2 & | p2,
|  | const T3 & | p3,
|  | const T4 & | p4
| ) |  |

Search for all occurrences

Definition at line 191 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3, p4);
    }

T* FbxNew | ( | const T1 & | p1,
|  | T2 & | p2,
|  | T3 & | p3,
|  | T4 & | p4
| ) |  |

Search for all occurrences

Definition at line 197 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3, p4);
    }

T* FbxNew | ( | const T1 & | p1,
|  | T2 & | p2,
|  | T3 & | p3,
|  | const T4 & | p4
| ) |  |

Search for all occurrences

Definition at line 203 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3, p4);
    }

T* FbxNew | ( | const T1 & | p1,
|  | T2 & | p2,
|  | const T3 & | p3,
|  | T4 & | p4
| ) |  |

Search for all occurrences

Definition at line 209 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3, p4);
    }

T* FbxNew | ( | const T1 & | p1,
|  | T2 & | p2,
|  | const T3 & | p3,
|  | const T4 & | p4
| ) |  |

Search for all occurrences

Definition at line 215 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3, p4);
    }

T* FbxNew | ( | const T1 & | p1,
|  | const T2 & | p2,
|  | T3 & | p3,
|  | T4 & | p4
| ) |  |

Search for all occurrences

Definition at line 221 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3, p4);
    }

T* FbxNew | ( | const T1 & | p1,
|  | const T2 & | p2,
|  | T3 & | p3,
|  | const T4 & | p4
| ) |  |

Search for all occurrences

Definition at line 227 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3, p4);
    }

T* FbxNew | ( | const T1 & | p1,
|  | const T2 & | p2,
|  | const T3 & | p3,
|  | T4 & | p4
| ) |  |

Search for all occurrences

Definition at line 233 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3, p4);
    }

T* FbxNew | ( | const T1 & | p1,
|  | const T2 & | p2,
|  | const T3 & | p3,
|  | const T4 & | p4
| ) |  |

Search for all occurrences

Definition at line 239 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1, p2, p3, p4);
    }

T* FbxNew | ( | const T1 & | p1,
|  | const T2 & | p2,
|  | const T3 & | p3,
|  | const T4 & | p4,
|  | const T5 & | p5
| ) |  |

Search for all occurrences

Definition at line 245 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1,p2,p3,p4,p5);
    }

T* FbxNew | ( | const T1 & | p1,
|  | const T2 & | p2,
|  | const T3 & | p3,
|  | const T4 & | p4,
|  | const T5 & | p5,
|  | const T6 & | p6
| ) |  |

Search for all occurrences

Definition at line 251 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1,p2,p3,p4,p5,p6);
    }

T* FbxNew | ( | const T1 & | p1,
|  | const T2 & | p2,
|  | const T3 & | p3,
|  | const T4 & | p4,
|  | const T5 & | p5,
|  | const T6 & | p6,
|  | const T7 & | p7
| ) |  |

Search for all occurrences

Definition at line 257 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1,p2,p3,p4,p5,p6,p7);
    }

T* FbxNew | ( | const T1 & | p1,
|  | const T2 & | p2,
|  | const T3 & | p3,
|  | const T4 & | p4,
|  | const T5 & | p5,
|  | const T6 & | p6,
|  | const T7 & | p7,
|  | const T8 & | p8
| ) |  |

Search for all occurrences

Definition at line 263 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1,p2,p3,p4,p5,p6,p7,p8);
    }

T* FbxNew | ( | const T1 & | p1,
|  | const T2 & | p2,
|  | const T3 & | p3,
|  | const T4 & | p4,
|  | const T5 & | p5,
|  | const T6 & | p6,
|  | const T7 & | p7,
|  | const T8 & | p8,
|  | const T9 & | p9
| ) |  |

Search for all occurrences

Definition at line 269 of file fbxnew.h.

    {
        T* p = (T*)FbxMalloc(sizeof(T));
        return new(p)T(p1,p2,p3,p4,p5,p6,p7,p8,p9);
    }

void FbxDelete | ( | T * | p | ) |

Search for all occurrences

Definition at line 275 of file fbxnew.h.

    {
        if( p )
        {
            ((T*)p)->~T();
            FbxFree(p);
        }
    }

void FbxDelete | ( | const T * | p | ) |

Search for all occurrences

Definition at line 284 of file fbxnew.h.

    {
        if( p )
        {
            ((T*)p)->~T();
            FbxFree(const_cast<T*>(p));
        }
    }

T* FbxNewArray | ( | int | n | ) |

Search for all occurrences

Definition at line 293 of file fbxnew.h.

    {
        if( FBXSDK_IS_SIMPLE_TYPE(T) )
        {
            return (T*)FbxMalloc(sizeof(T)*n);
        }
        else
        {
            void *pTmp = FbxMalloc(sizeof(T)*n+sizeof(int));
            T* p = (T*)((int*)pTmp+1);
            *((int*)pTmp) = n;
            for(int i=0;i<n;++i)
                new((T*)p+i)T;
            return p;
        }
    }

void FbxDeleteArray | ( | T * | p | ) |

Search for all occurrences

Definition at line 310 of file fbxnew.h.

    {
        if( p )
        {
            if( !FBXSDK_IS_SIMPLE_TYPE(T) )
            {
                for(int i=0;i<((int*)p)[-1];++i)
                    ((T*)p)[i].~T();
                FbxFree((int*)p-1);
            }
            else
            {
                FbxFree((void*)p);
            }
        }
    }