Go to the documentation of this file.00001 #ifndef __FBUNION_H__
00002 #define __FBUNION_H__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include <kaydaradef.h>
00040 #ifndef FBSDK_DLL
00041
00044 #define FBSDK_DLL K_DLLIMPORT
00045 #endif
00046
00047 #include <fbsdk/fbcomponent.h>
00048 #include <fbsdk/fbcore.h>
00049
00050 class KUnion;
00051
00052 #ifdef FBSDKUseNamespace
00053 namespace FBSDKNamespace {
00054 #endif
00055
00056 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00057
00059 __FB_FORWARD(FBLogger);
00060 __FB_FORWARD(FBVisitor);
00061
00063
00065
00070 class FBSDK_DLL FBUnion {
00071 public:
00075 FBUnion(KUnion *pValue = NULL);
00076
00080 FBUnion(FBUnion const &pValue);
00081
00086 FBUnion &operator = (FBUnion const &pValue);
00087
00090 ~FBUnion();
00091
00092
00098 static FBUnion DumpObject (FBPlug const &pObject, int pDepth = 1);
00099
00100
00101
00102
00103
00104
00105
00106 void Visit(FBVisitor &pVisitor) const;
00107
00110 void Trace(int pDepth = 20) const;
00111
00112 private:
00113
00114 KUnion *mValue;
00115 };
00116
00117
00118
00122 class FBSDK_DLL FBVisitor
00123 {
00124 public:
00127 virtual void operator () () = 0;
00128
00132 virtual void operator () (int &pVal) = 0;
00133
00137 virtual void operator () (long long &pVal) = 0;
00138
00142 virtual void operator () (unsigned long long &pVal) = 0;
00143
00147 virtual void operator () (double &pVal) = 0;
00148
00152 virtual void operator () (float &pVal) = 0;
00153
00157 virtual void operator () (bool &pVal) = 0;
00158
00162 virtual void operator () (FBTime const &pVal) = 0;
00163
00167 virtual void operator () (const char *pVal) = 0;
00168
00173 virtual void operator () (HdlFBPlug const &pVal) = 0;
00174
00178 virtual void operator () (FBVector2d const &pVal) = 0;
00179
00183 virtual void operator () (FBVector3d const &pVal) = 0;
00184
00188 virtual void operator () (FBVector4d const &pVal) = 0;
00189
00194 virtual void BeginMap() = 0;
00195
00201 virtual void operator () (const char *pName, FBUnion const &pVal) = 0;
00202
00205 virtual void EndMap() = 0;
00206
00211 virtual void BeginArray() = 0;
00212
00218 virtual void operator () (int pIndex, FBUnion const &pVal) = 0;
00219
00222 virtual void EndArray() = 0;
00223
00226 virtual ~FBVisitor() { }
00227 };
00228
00229 #endif // DOXYGEN_SHOULD_SKIP_THIS
00230
00231 #ifdef FBSDKUseNamespace
00232 }
00233 #endif
00234
00235 #endif