00001
00002
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
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #define OSG_COMPILEFCPTRATTRIBUTEMAPINST
00055
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058
00059 #include <OSGConfig.h>
00060
00061 #include "OSGFCPtrAttributeMapBase.h"
00062 #include "OSGFCPtrAttributeMap.h"
00063
00064
00065 OSG_BEGIN_NAMESPACE
00066
00067 const OSG::BitVector FCPtrAttributeMapBase::KeysFieldMask =
00068 (TypeTraits<BitVector>::One << FCPtrAttributeMapBase::KeysFieldId);
00069
00070 const OSG::BitVector FCPtrAttributeMapBase::ValuesFieldMask =
00071 (TypeTraits<BitVector>::One << FCPtrAttributeMapBase::ValuesFieldId);
00072
00073 const OSG::BitVector FCPtrAttributeMapBase::MTInfluenceMask =
00074 (Inherited::MTInfluenceMask) |
00075 (static_cast<BitVector>(0x0) << Inherited::NextFieldId);
00076
00077
00078
00079
00087
00088
00089 FieldDescription *FCPtrAttributeMapBase::_desc[] =
00090 {
00091 new FieldDescription(MFString::getClassType(),
00092 "keys",
00093 KeysFieldId, KeysFieldMask,
00094 false,
00095 reinterpret_cast<FieldAccessMethod>(&FCPtrAttributeMapBase::editMFKeys)),
00096 new FieldDescription(MFFieldContainerPtr::getClassType(),
00097 "values",
00098 ValuesFieldId, ValuesFieldMask,
00099 false,
00100 reinterpret_cast<FieldAccessMethod>(&FCPtrAttributeMapBase::editMFValues))
00101 };
00102
00103
00104 FieldContainerType FCPtrAttributeMapBase::_type(
00105 "FCPtrAttributeMap",
00106 "Attachment",
00107 NULL,
00108 reinterpret_cast<PrototypeCreateF>(&FCPtrAttributeMapBase::createEmpty),
00109 FCPtrAttributeMap::initMethod,
00110 _desc,
00111 sizeof(_desc));
00112
00113
00114
00115
00116
00117 FieldContainerType &FCPtrAttributeMapBase::getType(void)
00118 {
00119 return _type;
00120 }
00121
00122 const FieldContainerType &FCPtrAttributeMapBase::getType(void) const
00123 {
00124 return _type;
00125 }
00126
00127
00128 FieldContainerPtr FCPtrAttributeMapBase::shallowCopy(void) const
00129 {
00130 FCPtrAttributeMapPtr returnValue;
00131
00132 newPtr(returnValue, dynamic_cast<const FCPtrAttributeMap *>(this));
00133
00134 return returnValue;
00135 }
00136
00137 UInt32 FCPtrAttributeMapBase::getContainerSize(void) const
00138 {
00139 return sizeof(FCPtrAttributeMap);
00140 }
00141
00142
00143 #if !defined(OSG_FIXED_MFIELDSYNC)
00144 void FCPtrAttributeMapBase::executeSync( FieldContainer &other,
00145 const BitVector &whichField)
00146 {
00147 this->executeSyncImpl(static_cast<FCPtrAttributeMapBase *>(&other),
00148 whichField);
00149 }
00150 #else
00151 void FCPtrAttributeMapBase::executeSync( FieldContainer &other,
00152 const BitVector &whichField, const SyncInfo &sInfo )
00153 {
00154 this->executeSyncImpl((FCPtrAttributeMapBase *) &other, whichField, sInfo);
00155 }
00156 void FCPtrAttributeMapBase::execBeginEdit(const BitVector &whichField,
00157 UInt32 uiAspect,
00158 UInt32 uiContainerSize)
00159 {
00160 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00161 }
00162
00163 void FCPtrAttributeMapBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00164 {
00165 Inherited::onDestroyAspect(uiId, uiAspect);
00166
00167 _mfKeys.terminateShare(uiAspect, this->getContainerSize());
00168 _mfValues.terminateShare(uiAspect, this->getContainerSize());
00169 }
00170 #endif
00171
00172
00173
00174 #ifdef OSG_WIN32_ICL
00175 #pragma warning (disable : 383)
00176 #endif
00177
00178 FCPtrAttributeMapBase::FCPtrAttributeMapBase(void) :
00179 _mfKeys (),
00180 _mfValues (),
00181 Inherited()
00182 {
00183 }
00184
00185 #ifdef OSG_WIN32_ICL
00186 #pragma warning (default : 383)
00187 #endif
00188
00189 FCPtrAttributeMapBase::FCPtrAttributeMapBase(const FCPtrAttributeMapBase &source) :
00190 _mfKeys (source._mfKeys ),
00191 _mfValues (source._mfValues ),
00192 Inherited (source)
00193 {
00194 }
00195
00196
00197
00198 FCPtrAttributeMapBase::~FCPtrAttributeMapBase(void)
00199 {
00200 }
00201
00202
00203
00204 UInt32 FCPtrAttributeMapBase::getBinSize(const BitVector &whichField)
00205 {
00206 UInt32 returnValue = Inherited::getBinSize(whichField);
00207
00208 if(FieldBits::NoField != (KeysFieldMask & whichField))
00209 {
00210 returnValue += _mfKeys.getBinSize();
00211 }
00212
00213 if(FieldBits::NoField != (ValuesFieldMask & whichField))
00214 {
00215 returnValue += _mfValues.getBinSize();
00216 }
00217
00218
00219 return returnValue;
00220 }
00221
00222 void FCPtrAttributeMapBase::copyToBin( BinaryDataHandler &pMem,
00223 const BitVector &whichField)
00224 {
00225 Inherited::copyToBin(pMem, whichField);
00226
00227 if(FieldBits::NoField != (KeysFieldMask & whichField))
00228 {
00229 _mfKeys.copyToBin(pMem);
00230 }
00231
00232 if(FieldBits::NoField != (ValuesFieldMask & whichField))
00233 {
00234 _mfValues.copyToBin(pMem);
00235 }
00236
00237
00238 }
00239
00240 void FCPtrAttributeMapBase::copyFromBin( BinaryDataHandler &pMem,
00241 const BitVector &whichField)
00242 {
00243 Inherited::copyFromBin(pMem, whichField);
00244
00245 if(FieldBits::NoField != (KeysFieldMask & whichField))
00246 {
00247 _mfKeys.copyFromBin(pMem);
00248 }
00249
00250 if(FieldBits::NoField != (ValuesFieldMask & whichField))
00251 {
00252 _mfValues.copyFromBin(pMem);
00253 }
00254
00255
00256 }
00257
00258 #if !defined(OSG_FIXED_MFIELDSYNC)
00259 void FCPtrAttributeMapBase::executeSyncImpl( FCPtrAttributeMapBase *pOther,
00260 const BitVector &whichField)
00261 {
00262
00263 Inherited::executeSyncImpl(pOther, whichField);
00264
00265 if(FieldBits::NoField != (KeysFieldMask & whichField))
00266 _mfKeys.syncWith(pOther->_mfKeys);
00267
00268 if(FieldBits::NoField != (ValuesFieldMask & whichField))
00269 _mfValues.syncWith(pOther->_mfValues);
00270
00271
00272 }
00273 #else
00274 void FCPtrAttributeMapBase::executeSyncImpl( FCPtrAttributeMapBase *pOther,
00275 const BitVector &whichField,
00276 const SyncInfo &sInfo )
00277 {
00278
00279 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00280
00281
00282 if(FieldBits::NoField != (KeysFieldMask & whichField))
00283 _mfKeys.syncWith(pOther->_mfKeys, sInfo);
00284
00285 if(FieldBits::NoField != (ValuesFieldMask & whichField))
00286 _mfValues.syncWith(pOther->_mfValues, sInfo);
00287
00288
00289 }
00290
00291 void FCPtrAttributeMapBase::execBeginEditImpl (const BitVector &whichField,
00292 UInt32 uiAspect,
00293 UInt32 uiContainerSize)
00294 {
00295 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00296
00297 if(FieldBits::NoField != (KeysFieldMask & whichField))
00298 _mfKeys.beginEdit(uiAspect, uiContainerSize);
00299
00300 if(FieldBits::NoField != (ValuesFieldMask & whichField))
00301 _mfValues.beginEdit(uiAspect, uiContainerSize);
00302
00303 }
00304 #endif
00305
00306
00307
00308 OSG_END_NAMESPACE
00309
00310 #include <OSGSFieldTypeDef.inl>
00311
00312 OSG_BEGIN_NAMESPACE
00313
00314 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00315 DataType FieldDataTraits<FCPtrAttributeMapPtr>::_type("FCPtrAttributeMapPtr", "AttachmentPtr");
00316 #endif
00317
00318 OSG_DLLEXPORT_SFIELD_DEF1(FCPtrAttributeMapPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00319
00320
00321
00322
00323
00324 #ifdef OSG_SGI_CC
00325 #pragma set woff 1174
00326 #endif
00327
00328 #ifdef OSG_LINUX_ICC
00329 #pragma warning( disable : 177 )
00330 #endif
00331
00332 namespace
00333 {
00334 static Char8 cvsid_cpp [] = "@(#)$Id: OSGFCPtrAttributeMapBase.cpp,v 1.5 2008/06/09 12:28:09 vossg Exp $";
00335 static Char8 cvsid_hpp [] = OSGFCPTRATTRIBUTEMAPBASE_HEADER_CVSID;
00336 static Char8 cvsid_inl [] = OSGFCPTRATTRIBUTEMAPBASE_INLINE_CVSID;
00337
00338 static Char8 cvsid_fields_hpp[] = OSGFCPTRATTRIBUTEMAPFIELDS_HEADER_CVSID;
00339 }
00340
00341 OSG_END_NAMESPACE
00342