HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FBX_SceneProxySupport.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: FBX_SceneSupport.h (FBX Library, C++)
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef __FBX_SCENEPROXYSUPPORT_H_INCLUDED__
13 #define __FBX_SCENEPROXYSUPPORT_H_INCLUDED__
14 
15 #include <SYS/SYS_Compiler.h>
16 #include <SYS/SYS_Hash.h>
17 
18 #define FBX_SCENEPROXY_DECLARE_ID(TYPE) \
19  class TYPE \
20  { \
21  public: \
22  TYPE() : myPtr(nullptr) { } \
23  SYS_SAFE_BOOL operator bool() const { return myPtr!=nullptr; } \
24  bool operator==(const TYPE& x) const { return myPtr == x.myPtr; } \
25  bool operator!=(const TYPE& x) const { return !(*this == x); } \
26  size_t hash() const { return SYShash(myPtr); } \
27  private: \
28  TYPE(void *p) : myPtr(p) { } \
29  void* myPtr; \
30  friend class FBX_SceneProxy; \
31  }; \
32  inline size_t hash_value(TYPE id) { return id.hash(); } \
33  /**/
34 
35 #endif // __FBX_SCENEPROXYSUPPORT_H_INCLUDED__