Changeset 1032 for branches/Carsten_PtrWork2/Source/System/FieldContainer/Base/OSGContainerDefines.h
- Timestamp:
- 12/12/07 18:00:42 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/Carsten_PtrWork2/Source/System/FieldContainer/Base/OSGContainerDefines.h
r874 r1032 181 181 182 182 #define OSG_RC_CREATE_DECL \ 183 static Obj Ptr create(void)183 static ObjRefPtr create(void) 184 184 185 185 #define OSG_RC_CREATE_EMPTY_DECL \ … … 187 187 188 188 #define OSG_FC_SHALLOWCOPY_DECL \ 189 virtual OSG::FieldContainer Ptr shallowCopy(void) const189 virtual OSG::FieldContainerRefPtr shallowCopy(void) const 190 190 191 191 #define OSG_FB_SHALLOWCOPY_DECL \ … … 205 205 206 206 #define OSG_FC_SHALLOWCOPY_DEF(OSG_CLASS) \ 207 OSG::FieldContainerPtr OSG_CLASS::shallowCopy(void) const \ 207 OSG::FieldContainerRefPtr OSG_CLASS::shallowCopy(void) const \ 208 { \ 209 ObjPtr returnValue; \ 210 \ 211 newPtr<Self>(returnValue, this); \ 212 \ 213 return FieldContainerRefPtr(returnValue); \ 214 } 215 216 #define OSG_FB_SHALLOWCOPY_DEF(OSG_CLASS) \ 217 OSG::FieldBundleP OSG_CLASS::shallowCopy(void) const \ 208 218 { \ 209 219 ObjPtr returnValue; \ … … 214 224 } 215 225 216 #define OSG_FB_SHALLOWCOPY_DEF(OSG_CLASS) \217 OSG::FieldBundleP OSG_CLASS::shallowCopy(void) const \218 { \219 ObjPtr returnValue; \220 \221 newPtr<Self>(returnValue, this); \222 \223 return returnValue; \224 }225 226 226 #define OSG_FC_SHALLOWCOPY_TMPL_DEF(OSG_CLASS, OSG_TMPL_PARAM, INLINE) \ 227 227 template < class OSG_TMPL_PARAM > INLINE \ 228 OSG::FieldContainer Ptr\228 OSG::FieldContainerRefPtr \ 229 229 OSG_CLASS< OSG_TMPL_PARAM >::shallowCopy(void) const \ 230 230 { \ … … 233 233 Self::template newPtr<Self>(returnValue, this); \ 234 234 \ 235 return returnValue;\235 return FieldContainerRefPtr(returnValue); \ 236 236 } 237 237 … … 263 263 #define OSG_RC_CREATE_INL_DEF(OSG_CLASS) \ 264 264 inline \ 265 OSG_CLASS::Obj Ptr OSG_CLASS::create(void)\266 { \ 267 Obj Ptr fc;\265 OSG_CLASS::ObjRefPtr OSG_CLASS::create(void) \ 266 { \ 267 ObjRefPtr fc; \ 268 268 \ 269 269 if(getClassType().getPrototype() != OSGNullFC) \ 270 fc = dynamic_cast<Self::ObjPtr>(\271 getClassType().getPrototype()->shallowCopy());\270 fc = boost::dynamic_pointer_cast<Self>( \ 271 getClassType().getPrototype()->shallowCopy()); \ 272 272 \ 273 273 return fc; \ … … 276 276 #define OSG_FC_CREATE_TMPL_DEF(OSG_CLASS, OSG_TMPL_PARAM, INLINE) \ 277 277 template < class OSG_TMPL_PARAM > INLINE \ 278 typename OSG_CLASS < OSG_TMPL_PARAM >::Obj Ptr\278 typename OSG_CLASS < OSG_TMPL_PARAM >::ObjRefPtr \ 279 279 OSG_CLASS< OSG_TMPL_PARAM >::create(void) \ 280 280 { \ 281 Obj Ptr fc;\281 ObjRefPtr fc; \ 282 282 \ 283 283 if(getClassType().getPrototype() != OSGNullFC) \ 284 284 { \ 285 OSG::FieldContainerPtr temp_ptr = \ 286 getClassType().getPrototype()->shallowCopy(); \ 287 fc = dynamic_cast<typename Self::ObjPtr>(temp_ptr); \ 285 fc = boost::dynamic_pointer_cast<Self>( \ 286 getClassType().getPrototype()->shallowCopy()); \ 288 287 } \ 289 288 \ … … 300 299 if(getClassType().getPrototype() != OSGNullFC) \ 301 300 { \ 302 OSG::FieldBundleP temp_ptr = \ 303 getClassType().getPrototype()->shallowCopy(); \ 304 fc = dynamic_cast<typename Self::ObjPtr>(temp_ptr); \ 301 fc = dynamic_cast<Self::ObjPtr>( \ 302 getClassType().getPrototype()->shallowCopy()); \ 305 303 } \ 306 304 \ … … 323 321 #define OSG_FC_CREATE_SPECIALIZED_TMPL_DEF(OSG_CLASS, OSG_TMPL_PARAM) \ 324 322 template <> OSG_DLL_EXPORT \ 325 OSG_CLASS < OSG_TMPL_PARAM >::Obj Ptr\323 OSG_CLASS < OSG_TMPL_PARAM >::ObjRefPtr \ 326 324 OSG_CLASS< OSG_TMPL_PARAM >::create(void) \ 327 325 { \ 328 Obj Ptr fc;\326 ObjRefPtr fc; \ 329 327 \ 330 328 if(getClassType().getPrototype() != OSGNullFC) \ 331 329 { \ 332 OSG::FieldContainerPtr temp_ptr = \ 333 getClassType().getPrototype()->shallowCopy(); \ 334 fc = dynamic_cast<Self::ObjPtr>(temp_ptr); \ 330 fc = boost::dynamic_pointer_cast<Self>( \ 331 getClassType().getPrototype()->shallowCopy()); \ 335 332 } \ 336 333 \
