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_USING_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 (FieldAccessMethod) &FCPtrAttributeMapBase::getMFKeys),
00096 new FieldDescription(MFFieldContainerPtr::getClassType(),
00097 "values",
00098 ValuesFieldId, ValuesFieldMask,
00099 false,
00100 (FieldAccessMethod) &FCPtrAttributeMapBase::getMFValues)
00101 };
00102
00103
00104 FieldContainerType FCPtrAttributeMapBase::_type(
00105 "FCPtrAttributeMap",
00106 "Attachment",
00107 NULL,
00108 (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((FCPtrAttributeMapBase *) &other, whichField);
00148 }
00149 #else
00150 void FCPtrAttributeMapBase::executeSync( FieldContainer &other,
00151 const BitVector &whichField, const SyncInfo &sInfo )
00152 {
00153 this->executeSyncImpl((FCPtrAttributeMapBase *) &other, whichField, sInfo);
00154 }
00155 void FCPtrAttributeMapBase::execBeginEdit(const BitVector &whichField,
00156 UInt32 uiAspect,
00157 UInt32 uiContainerSize)
00158 {
00159 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00160 }
00161
00162 void FCPtrAttributeMapBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00163 {
00164 Inherited::onDestroyAspect(uiId, uiAspect);
00165
00166 _mfKeys.terminateShare(uiAspect, this->getContainerSize());
00167 _mfValues.terminateShare(uiAspect, this->getContainerSize());
00168 }
00169 #endif
00170
00171
00172
00173 #ifdef OSG_WIN32_ICL
00174 #pragma warning (disable : 383)
00175 #endif
00176
00177 FCPtrAttributeMapBase::FCPtrAttributeMapBase(void) :
00178 _mfKeys (),
00179 _mfValues (),
00180 Inherited()
00181 {
00182 }
00183
00184 #ifdef OSG_WIN32_ICL
00185 #pragma warning (default : 383)
00186 #endif
00187
00188 FCPtrAttributeMapBase::FCPtrAttributeMapBase(const FCPtrAttributeMapBase &source) :
00189 _mfKeys (source._mfKeys ),
00190 _mfValues (source._mfValues ),
00191 Inherited (source)
00192 {
00193 }
00194
00195
00196
00197 FCPtrAttributeMapBase::~FCPtrAttributeMapBase(void)
00198 {
00199 }
00200
00201
00202
00203 UInt32 FCPtrAttributeMapBase::getBinSize(const BitVector &whichField)
00204 {
00205 UInt32 returnValue = Inherited::getBinSize(whichField);
00206
00207 if(FieldBits::NoField != (KeysFieldMask & whichField))
00208 {
00209 returnValue += _mfKeys.getBinSize();
00210 }
00211
00212 if(FieldBits::NoField != (ValuesFieldMask & whichField))
00213 {
00214 returnValue += _mfValues.getBinSize();
00215 }
00216
00217
00218 return returnValue;
00219 }
00220
00221 void FCPtrAttributeMapBase::copyToBin( BinaryDataHandler &pMem,
00222 const BitVector &whichField)
00223 {
00224 Inherited::copyToBin(pMem, whichField);
00225
00226 if(FieldBits::NoField != (KeysFieldMask & whichField))
00227 {
00228 _mfKeys.copyToBin(pMem);
00229 }
00230
00231 if(FieldBits::NoField != (ValuesFieldMask & whichField))
00232 {
00233 _mfValues.copyToBin(pMem);
00234 }
00235
00236
00237 }
00238
00239 void FCPtrAttributeMapBase::copyFromBin( BinaryDataHandler &pMem,
00240 const BitVector &whichField)
00241 {
00242 Inherited::copyFromBin(pMem, whichField);
00243
00244 if(FieldBits::NoField != (KeysFieldMask & whichField))
00245 {
00246 _mfKeys.copyFromBin(pMem);
00247 }
00248
00249 if(FieldBits::NoField != (ValuesFieldMask & whichField))
00250 {
00251 _mfValues.copyFromBin(pMem);
00252 }
00253
00254
00255 }
00256
00257 #if !defined(OSG_FIXED_MFIELDSYNC)
00258 void FCPtrAttributeMapBase::executeSyncImpl( FCPtrAttributeMapBase *pOther,
00259 const BitVector &whichField)
00260 {
00261
00262 Inherited::executeSyncImpl(pOther, whichField);
00263
00264 if(FieldBits::NoField != (KeysFieldMask & whichField))
00265 _mfKeys.syncWith(pOther->_mfKeys);
00266
00267 if(FieldBits::NoField != (ValuesFieldMask & whichField))
00268 _mfValues.syncWith(pOther->_mfValues);
00269
00270
00271 }
00272 #else
00273 void FCPtrAttributeMapBase::executeSyncImpl( FCPtrAttributeMapBase *pOther,
00274 const BitVector &whichField,
00275 const SyncInfo &sInfo )
00276 {
00277
00278 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00279
00280
00281 if(FieldBits::NoField != (KeysFieldMask & whichField))
00282 _mfKeys.syncWith(pOther->_mfKeys, sInfo);
00283
00284 if(FieldBits::NoField != (ValuesFieldMask & whichField))
00285 _mfValues.syncWith(pOther->_mfValues, sInfo);
00286
00287
00288 }
00289
00290 void FCPtrAttributeMapBase::execBeginEditImpl (const BitVector &whichField,
00291 UInt32 uiAspect,
00292 UInt32 uiContainerSize)
00293 {
00294 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00295
00296 if(FieldBits::NoField != (KeysFieldMask & whichField))
00297 _mfKeys.beginEdit(uiAspect, uiContainerSize);
00298
00299 if(FieldBits::NoField != (ValuesFieldMask & whichField))
00300 _mfValues.beginEdit(uiAspect, uiContainerSize);
00301
00302 }
00303 #endif
00304
00305
00306
00307 #include <OSGSFieldTypeDef.inl>
00308
00309 OSG_BEGIN_NAMESPACE
00310
00311 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00312 DataType FieldDataTraits<FCPtrAttributeMapPtr>::_type("FCPtrAttributeMapPtr", "AttachmentPtr");
00313 #endif
00314
00315 OSG_DLLEXPORT_SFIELD_DEF1(FCPtrAttributeMapPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00316
00317 OSG_END_NAMESPACE
00318
00319
00320
00321
00322
00323 #ifdef OSG_SGI_CC
00324 #pragma set woff 1174
00325 #endif
00326
00327 #ifdef OSG_LINUX_ICC
00328 #pragma warning( disable : 177 )
00329 #endif
00330
00331 namespace
00332 {
00333 static Char8 cvsid_cpp [] = "@(#)$Id: OSGFCPtrAttributeMapBase.cpp,v 1.2 2006/02/20 16:54:57 dirk Exp $";
00334 static Char8 cvsid_hpp [] = OSGFCPTRATTRIBUTEMAPBASE_HEADER_CVSID;
00335 static Char8 cvsid_inl [] = OSGFCPTRATTRIBUTEMAPBASE_INLINE_CVSID;
00336
00337 static Char8 cvsid_fields_hpp[] = OSGFCPTRATTRIBUTEMAPFIELDS_HEADER_CVSID;
00338 }
00339