FBX C++ API Reference
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]>
 
struct  FbxSimpleType< bool >
 
struct  FbxSimpleType< char >
 
struct  FbxSimpleType< unsigned char >
 
struct  FbxSimpleType< short >
 
struct  FbxSimpleType< unsigned short >
 
struct  FbxSimpleType< int >
 
struct  FbxSimpleType< unsigned int >
 
struct  FbxSimpleType< long >
 
struct  FbxSimpleType< unsigned long >
 
struct  FbxSimpleType< float >
 
struct  FbxSimpleType< double >
 
struct  FbxSimpleType< long double >
 
struct  FbxSimpleType< long long >
 
struct  FbxSimpleType< unsigned long long >
 

Macros

#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

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 (T1 &p1, T2 &p2, T3 &p3, T4 &p4, T5 &p5)
 
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
T * FbxNew (const T1 &p1, T2 &p2, T3 &p3, T4 &p4, T5 &p5)
 
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
T * FbxNew (const T1 &p1, const T2 &p2, T3 &p3, T4 &p4, T5 &p5)
 
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
T * FbxNew (const T1 &p1, T2 &p2, const T3 &p3, T4 &p4, T5 &p5)
 
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
T * FbxNew (const T1 &p1, T2 &p2, T3 &p3, const T4 &p4, T5 &p5)
 
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
T * FbxNew (const T1 &p1, T2 &p2, T3 &p3, T4 &p4, const T5 &p5)
 
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
T * FbxNew (const T1 &p1, const T2 &p2, const T3 &p3, T4 &p4, T5 &p5)
 
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
T * FbxNew (const T1 &p1, const T2 &p2, T3 &p3, const T4 &p4, T5 &p5)
 
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
T * FbxNew (const T1 &p1, const T2 &p2, T3 &p3, T4 &p4, const T5 &p5)
 
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, T5 &p5)
 
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
T * FbxNew (const T1 &p1, const T2 &p2, const T3 &p3, T4 &p4, const T5 &p5)
 
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)
 Deletion policy for pointer template classes that uses the FbxDelete() function. More...
 
template<typename T >
void FbxDelete (const T *p)
 
template<typename T >
T * FbxNewArray (const 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.

Macro Definition Documentation

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

Definition at line 40 of file fbxnew.h.

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

Definition at line 57 of file fbxnew.h.

#define FBXSDK_FRIEND_NEW ( )

Definition at line 420 of file fbxnew.h.

Function Documentation

T* FbxNew ( )

Definition at line 59 of file fbxnew.h.

60 {
61  T* p = (T*)FbxMalloc(sizeof(T));
62  return new(p)T();
63 }
T* FbxNew ( T1 &  p1)

Definition at line 65 of file fbxnew.h.

66 {
67  T* p = (T*)FbxMalloc(sizeof(T));
68  return new(p)T(p1);
69 }
T* FbxNew ( const T1 &  p1)

Definition at line 71 of file fbxnew.h.

72 {
73  T* p = (T*)FbxMalloc(sizeof(T));
74  return new(p)T(p1);
75 }
T* FbxNew ( T1 &  p1,
T2 &  p2 
)

Definition at line 77 of file fbxnew.h.

78 {
79  T* p = (T*)FbxMalloc(sizeof(T));
80  return new(p)T(p1, p2);
81 }
T* FbxNew ( T1 &  p1,
const T2 &  p2 
)

Definition at line 83 of file fbxnew.h.

84 {
85  T* p = (T*)FbxMalloc(sizeof(T));
86  return new(p)T(p1, p2);
87 }
T* FbxNew ( const T1 &  p1,
T2 &  p2 
)

Definition at line 89 of file fbxnew.h.

90 {
91  T* p = (T*)FbxMalloc(sizeof(T));
92  return new(p)T(p1, p2);
93 }
T* FbxNew ( const T1 &  p1,
const T2 &  p2 
)

Definition at line 95 of file fbxnew.h.

96 {
97  T* p = (T*)FbxMalloc(sizeof(T));
98  return new(p)T(p1, p2);
99 }
T* FbxNew ( T1 &  p1,
T2 &  p2,
T3 &  p3 
)

Definition at line 101 of file fbxnew.h.

102 {
103  T* p = (T*)FbxMalloc(sizeof(T));
104  return new(p)T(p1, p2, p3);
105 }
T* FbxNew ( T1 &  p1,
T2 &  p2,
const T3 &  p3 
)

Definition at line 107 of file fbxnew.h.

108 {
109  T* p = (T*)FbxMalloc(sizeof(T));
110  return new(p)T(p1, p2, p3);
111 }
T* FbxNew ( T1 &  p1,
const T2 &  p2,
T3 &  p3 
)

Definition at line 113 of file fbxnew.h.

114 {
115  T* p = (T*)FbxMalloc(sizeof(T));
116  return new(p)T(p1, p2, p3);
117 }
T* FbxNew ( T1 &  p1,
const T2 &  p2,
const T3 &  p3 
)

Definition at line 119 of file fbxnew.h.

120 {
121  T* p = (T*)FbxMalloc(sizeof(T));
122  return new(p)T(p1, p2, p3);
123 }
T* FbxNew ( const T1 &  p1,
T2 &  p2,
T3 &  p3 
)

Definition at line 125 of file fbxnew.h.

126 {
127  T* p = (T*)FbxMalloc(sizeof(T));
128  return new(p)T(p1, p2, p3);
129 }
T* FbxNew ( const T1 &  p1,
T2 &  p2,
const T3 &  p3 
)

Definition at line 131 of file fbxnew.h.

132 {
133  T* p = (T*)FbxMalloc(sizeof(T));
134  return new(p)T(p1, p2, p3);
135 }
T* FbxNew ( const T1 &  p1,
const T2 &  p2,
T3 &  p3 
)

Definition at line 137 of file fbxnew.h.

138 {
139  T* p = (T*)FbxMalloc(sizeof(T));
140  return new(p)T(p1, p2, p3);
141 }
T* FbxNew ( const T1 &  p1,
const T2 &  p2,
const T3 &  p3 
)

Definition at line 143 of file fbxnew.h.

144 {
145  T* p = (T*)FbxMalloc(sizeof(T));
146  return new(p)T(p1, p2, p3);
147 }
T* FbxNew ( T1 &  p1,
T2 &  p2,
T3 &  p3,
T4 &  p4 
)

Definition at line 149 of file fbxnew.h.

150 {
151  T* p = (T*)FbxMalloc(sizeof(T));
152  return new(p)T(p1, p2, p3, p4);
153 }
T* FbxNew ( T1 &  p1,
T2 &  p2,
T3 &  p3,
const T4 &  p4 
)

Definition at line 155 of file fbxnew.h.

156 {
157  T* p = (T*)FbxMalloc(sizeof(T));
158  return new(p)T(p1, p2, p3, p4);
159 }
T* FbxNew ( T1 &  p1,
T2 &  p2,
const T3 &  p3,
T4 &  p4 
)

Definition at line 161 of file fbxnew.h.

162 {
163  T* p = (T*)FbxMalloc(sizeof(T));
164  return new(p)T(p1, p2, p3, p4);
165 }
T* FbxNew ( T1 &  p1,
T2 &  p2,
const T3 &  p3,
const T4 &  p4 
)

Definition at line 167 of file fbxnew.h.

168 {
169  T* p = (T*)FbxMalloc(sizeof(T));
170  return new(p)T(p1, p2, p3, p4);
171 }
T* FbxNew ( T1 &  p1,
const T2 &  p2,
T3 &  p3,
T4 &  p4 
)

Definition at line 173 of file fbxnew.h.

174 {
175  T* p = (T*)FbxMalloc(sizeof(T));
176  return new(p)T(p1, p2, p3, p4);
177 }
T* FbxNew ( T1 &  p1,
const T2 &  p2,
T3 &  p3,
const T4 &  p4 
)

Definition at line 179 of file fbxnew.h.

180 {
181  T* p = (T*)FbxMalloc(sizeof(T));
182  return new(p)T(p1, p2, p3, p4);
183 }
T* FbxNew ( T1 &  p1,
const T2 &  p2,
const T3 &  p3,
T4 &  p4 
)

Definition at line 185 of file fbxnew.h.

186 {
187  T* p = (T*)FbxMalloc(sizeof(T));
188  return new(p)T(p1, p2, p3, p4);
189 }
T* FbxNew ( T1 &  p1,
const T2 &  p2,
const T3 &  p3,
const T4 &  p4 
)

Definition at line 191 of file fbxnew.h.

192 {
193  T* p = (T*)FbxMalloc(sizeof(T));
194  return new(p)T(p1, p2, p3, p4);
195 }
T* FbxNew ( const T1 &  p1,
T2 &  p2,
T3 &  p3,
T4 &  p4 
)

Definition at line 197 of file fbxnew.h.

198 {
199  T* p = (T*)FbxMalloc(sizeof(T));
200  return new(p)T(p1, p2, p3, p4);
201 }
T* FbxNew ( const T1 &  p1,
T2 &  p2,
T3 &  p3,
const T4 &  p4 
)

Definition at line 203 of file fbxnew.h.

204 {
205  T* p = (T*)FbxMalloc(sizeof(T));
206  return new(p)T(p1, p2, p3, p4);
207 }
T* FbxNew ( const T1 &  p1,
T2 &  p2,
const T3 &  p3,
T4 &  p4 
)

Definition at line 209 of file fbxnew.h.

210 {
211  T* p = (T*)FbxMalloc(sizeof(T));
212  return new(p)T(p1, p2, p3, p4);
213 }
T* FbxNew ( const T1 &  p1,
T2 &  p2,
const T3 &  p3,
const T4 &  p4 
)

Definition at line 215 of file fbxnew.h.

216 {
217  T* p = (T*)FbxMalloc(sizeof(T));
218  return new(p)T(p1, p2, p3, p4);
219 }
T* FbxNew ( const T1 &  p1,
const T2 &  p2,
T3 &  p3,
T4 &  p4 
)

Definition at line 221 of file fbxnew.h.

222 {
223  T* p = (T*)FbxMalloc(sizeof(T));
224  return new(p)T(p1, p2, p3, p4);
225 }
T* FbxNew ( const T1 &  p1,
const T2 &  p2,
T3 &  p3,
const T4 &  p4 
)

Definition at line 227 of file fbxnew.h.

228 {
229  T* p = (T*)FbxMalloc(sizeof(T));
230  return new(p)T(p1, p2, p3, p4);
231 }
T* FbxNew ( const T1 &  p1,
const T2 &  p2,
const T3 &  p3,
T4 &  p4 
)

Definition at line 233 of file fbxnew.h.

234 {
235  T* p = (T*)FbxMalloc(sizeof(T));
236  return new(p)T(p1, p2, p3, p4);
237 }
T* FbxNew ( const T1 &  p1,
const T2 &  p2,
const T3 &  p3,
const T4 &  p4 
)

Definition at line 239 of file fbxnew.h.

240 {
241  T* p = (T*)FbxMalloc(sizeof(T));
242  return new(p)T(p1, p2, p3, p4);
243 }
T* FbxNew ( T1 &  p1,
T2 &  p2,
T3 &  p3,
T4 &  p4,
T5 &  p5 
)

Definition at line 245 of file fbxnew.h.

246 {
247  T* p = (T*)FbxMalloc(sizeof(T));
248  return new(p)T(p1,p2,p3,p4,p5);
249 }
T* FbxNew ( const T1 &  p1,
T2 &  p2,
T3 &  p3,
T4 &  p4,
T5 &  p5 
)

Definition at line 251 of file fbxnew.h.

252 {
253  T* p = (T*)FbxMalloc(sizeof(T));
254  return new(p)T(p1,p2,p3,p4,p5);
255 }
T* FbxNew ( const T1 &  p1,
const T2 &  p2,
T3 &  p3,
T4 &  p4,
T5 &  p5 
)

Definition at line 257 of file fbxnew.h.

258 {
259  T* p = (T*)FbxMalloc(sizeof(T));
260  return new(p)T(p1,p2,p3,p4,p5);
261 }
T* FbxNew ( const T1 &  p1,
T2 &  p2,
const T3 &  p3,
T4 &  p4,
T5 &  p5 
)

Definition at line 263 of file fbxnew.h.

264 {
265  T* p = (T*)FbxMalloc(sizeof(T));
266  return new(p)T(p1,p2,p3,p4,p5);
267 }
T* FbxNew ( const T1 &  p1,
T2 &  p2,
T3 &  p3,
const T4 &  p4,
T5 &  p5 
)

Definition at line 269 of file fbxnew.h.

270 {
271  T* p = (T*)FbxMalloc(sizeof(T));
272  return new(p)T(p1,p2,p3,p4,p5);
273 }
T* FbxNew ( const T1 &  p1,
T2 &  p2,
T3 &  p3,
T4 &  p4,
const T5 &  p5 
)

Definition at line 275 of file fbxnew.h.

276 {
277  T* p = (T*)FbxMalloc(sizeof(T));
278  return new(p)T(p1,p2,p3,p4,p5);
279 }
T* FbxNew ( const T1 &  p1,
const T2 &  p2,
const T3 &  p3,
T4 &  p4,
T5 &  p5 
)

Definition at line 281 of file fbxnew.h.

282 {
283  T* p = (T*)FbxMalloc(sizeof(T));
284  return new(p)T(p1,p2,p3,p4,p5);
285 }
T* FbxNew ( const T1 &  p1,
const T2 &  p2,
T3 &  p3,
const T4 &  p4,
T5 &  p5 
)

Definition at line 287 of file fbxnew.h.

288 {
289  T* p = (T*)FbxMalloc(sizeof(T));
290  return new(p)T(p1,p2,p3,p4,p5);
291 }
T* FbxNew ( const T1 &  p1,
const T2 &  p2,
T3 &  p3,
T4 &  p4,
const T5 &  p5 
)

Definition at line 293 of file fbxnew.h.

294 {
295  T* p = (T*)FbxMalloc(sizeof(T));
296  return new(p)T(p1,p2,p3,p4,p5);
297 }
T* FbxNew ( const T1 &  p1,
const T2 &  p2,
const T3 &  p3,
const T4 &  p4,
T5 &  p5 
)

Definition at line 299 of file fbxnew.h.

300 {
301  T* p = (T*)FbxMalloc(sizeof(T));
302  return new(p)T(p1,p2,p3,p4,p5);
303 }
T* FbxNew ( const T1 &  p1,
const T2 &  p2,
const T3 &  p3,
T4 &  p4,
const T5 &  p5 
)

Definition at line 305 of file fbxnew.h.

306 {
307  T* p = (T*)FbxMalloc(sizeof(T));
308  return new(p)T(p1,p2,p3,p4,p5);
309 }
T* FbxNew ( const T1 &  p1,
const T2 &  p2,
const T3 &  p3,
const T4 &  p4,
const T5 &  p5 
)

Definition at line 311 of file fbxnew.h.

312 {
313  T* p = (T*)FbxMalloc(sizeof(T));
314  return new(p)T(p1,p2,p3,p4,p5);
315 }
T* FbxNew ( const T1 &  p1,
const T2 &  p2,
const T3 &  p3,
const T4 &  p4,
const T5 &  p5,
const T6 &  p6 
)

Definition at line 317 of file fbxnew.h.

318 {
319  T* p = (T*)FbxMalloc(sizeof(T));
320  return new(p)T(p1,p2,p3,p4,p5,p6);
321 }
T* FbxNew ( const T1 &  p1,
const T2 &  p2,
const T3 &  p3,
const T4 &  p4,
const T5 &  p5,
const T6 &  p6,
const T7 &  p7 
)

Definition at line 323 of file fbxnew.h.

324 {
325  T* p = (T*)FbxMalloc(sizeof(T));
326  return new(p)T(p1,p2,p3,p4,p5,p6,p7);
327 }
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 
)

Definition at line 329 of file fbxnew.h.

330 {
331  T* p = (T*)FbxMalloc(sizeof(T));
332  return new(p)T(p1,p2,p3,p4,p5,p6,p7,p8);
333 }
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 
)

Definition at line 335 of file fbxnew.h.

336 {
337  T* p = (T*)FbxMalloc(sizeof(T));
338  return new(p)T(p1,p2,p3,p4,p5,p6,p7,p8,p9);
339 }
void FbxDelete ( T *  p)

Deletion policy for pointer template classes that uses the FbxDelete() function.

Definition at line 341 of file fbxnew.h.

342 {
343  if( p )
344  {
345  ((T*)p)->~T();
346  FbxFree(p);
347  }
348 }
void FbxDelete ( const T *  p)

Definition at line 350 of file fbxnew.h.

351 {
352  if( p )
353  {
354  ((T*)p)->~T();
355  FbxFree(const_cast<T*>(p));
356  }
357 }
T* FbxNewArray ( const int  n)

Definition at line 366 of file fbxnew.h.

367 {
368  const size_t lSize = FbxAllocSize((size_t)n, sizeof(T));
369  if( FBXSDK_IS_SIMPLE_TYPE(T) )
370  {
371  return (T*)FbxMalloc(lSize);
372  }
373  else
374  {
375  // malloc usually provides 8-byte or 16-byte alignment on 32bit and 64bit architectures
376  // respectively. By allocating 8 or 16 bytes for the header info, rather than sizeof(int),
377  // we ensure this function maintains the same alignment behaviour as malloc.
378  void* const pTmp = FbxMalloc(lSize + MALLOC_HEADER_SIZE);
379  *static_cast<int*>(pTmp) = n;
380  T* const p = reinterpret_cast<T*>(static_cast<char*>(pTmp) + MALLOC_HEADER_SIZE);
381 
382  for( int i = 0; i < n; ++i )
383  {
384  new(p+i)T; // in-place new, not allocating memory so it is safe.
385  }
386  return p;
387  }
388 }
#define FBXSDK_IS_SIMPLE_TYPE(T)
Definition: fbxnew.h:57
void FbxDeleteArray ( T *  p)

Definition at line 390 of file fbxnew.h.

391 {
392  if( p )
393  {
394  if( !FBXSDK_IS_SIMPLE_TYPE(T) )
395  {
396 // When compiling on MacOS with libstdc++ we cannot use remove_const (it does not exist - not C++11)
397 #ifndef USING_LIBSTDCPP
398  typedef typename std::remove_const<T>::type TMutable;
399  TMutable* const pMutable = const_cast<TMutable*>(p);
400  // FbxNewArray allocates MALLOC_HEADER_SIZE extra bytes as a header to store the array length
401  void* const pTmp = reinterpret_cast<char*>(pMutable) - MALLOC_HEADER_SIZE;
402  const int n = *static_cast<int*>(pTmp);
403 #else
404  void* const pTmp = (char*)(p) - MALLOC_HEADER_SIZE;
405  const int n = *(int*)(pTmp);
406 #endif
407  for( int i = 0; i < n; ++i )
408  {
409  p[i].~T();
410  }
411  FbxFree(pTmp);
412  }
413  else
414  {
415  FbxFree((void*)p);
416  }
417  }
418 }
#define FBXSDK_IS_SIMPLE_TYPE(T)
Definition: fbxnew.h:57