Show
Ignore:
Timestamp:
10/24/07 19:30:30 (1 year ago)
Author:
cneumann
Message:

fixed: FieldBundle? templates, pointers and fields updated

lots of compile errors - some remain

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/Carsten_PtrWork/Source/System/FieldContainer/Base/OSGReferenceCountPointer.h

    r976 r988  
    4747 
    4848#include "OSGFieldContainer.h" 
     49#include "OSGFieldBundle.h" 
    4950 
    5051#include <boost/static_assert.hpp> 
    5152#include <boost/type_traits/is_convertible.hpp> 
     53#include <boost/shared_ptr.hpp> 
    5254 
    5355#ifdef OSG_DOC_FILES_IN_MODULE 
     
    9496struct OSG_SYSTEM_DLLMAPPING MTRefCountPolicy 
    9597{ 
    96 }; 
    97  
    98 template <> 
    99 struct OSG_SYSTEM_DLLMAPPING MTRefCountPolicy<FieldContainer> 
    100 
    101     OSG_GEN_NAMED_CONTAINER_PTR(FieldContainer, RootObject) 
     98    OSG_GEN_NAMED_CONTAINER_PTR(RootObjectT, RootObject) 
    10299 
    103100    static void          addRef(RootObjectPtrConstArg rootObjectPtr);   
     
    116113}; 
    117114 
     115 
    118116/*! \ingroup GrpSystemFieldContainer 
    119117    \class WeakRefCountPolicy<RootObjectT> 
     
    129127    static RootObjectPtr deref (RootObjectPtrConstArg rootObjectPtr); 
    130128}; 
     129 
     130namespace detail 
     131{ 
     132    // Internal tag type to designate that a static_cast is requested 
     133    struct StaticCastTag 
     134    { 
     135    }; 
     136 
     137    // Internal tag type to designate that a const_cast is requested 
     138    struct ConstCastTag 
     139    { 
     140    }; 
     141     
     142    // Inernal tag type to designate that a dynamic_cast is requested 
     143    struct DynamicCastTag 
     144    { 
     145    }; 
     146} // namespace detail 
     147 
    131148 
    132149/*! \ingroup GrpSystemFieldContainer 
     
    177194    ReferenceCountPointer( 
    178195        ReferenceCountPointer<OtherObjectT, 
    179                               OtherRefCountPolicyT> const &refPtr    ); 
     196                              OtherRefCountPolicyT, 
     197                              RootObject           > const &refPtr   ); 
     198                               
     199    template <class OtherObjectT, class OtherRefCountPolicyT> 
     200    ReferenceCountPointer( 
     201        ReferenceCountPointer<OtherObjectT, 
     202                              OtherRefCountPolicyT, 
     203                              RootObject           > const &refPtr, 
     204        detail::StaticCastTag                                        ); 
     205         
     206    template <class OtherObjectT, class OtherRefCountPolicyT> 
     207    ReferenceCountPointer( 
     208        ReferenceCountPointer<OtherObjectT, 
     209                              OtherRefCountPolicyT, 
     210                              RootObject           > const &refPtr, 
     211        detail::ConstCastTag                                         ); 
     212     
     213    template <class OtherObjectT, class OtherRefCountPolicyT> 
     214    ReferenceCountPointer( 
     215        ReferenceCountPointer<OtherObjectT, 
     216                              OtherRefCountPolicyT, 
     217                              RootObject           > const &refPtr, 
     218        detail::DynamicCastTag                                       ); 
    180219                                                     
    181220    /*! \}                                                                 */ 
     
    197236    Self &operator=( 
    198237        ReferenceCountPointer<OtherObjectT, 
    199                               OtherRefCountPolicy>  const &refPtr    ); 
     238                              OtherRefCountPolicy, 
     239                              RootObject          > const &refPtr    ); 
    200240         
    201241    /*! \}                                                                 */ 
     
    288328          class RefCountPolicyT, class RootObjectT   > 
    289329OSG::ReferenceCountPointer<TargetObjectT, RefCountPolicyT, RootObjectT> 
     330static_pointer_cast(OSG::ReferenceCountPointer<SourceObjectT, 
     331                                               RefCountPolicyT, 
     332                                               RootObjectT     > const &source); 
     333 
     334template <class TargetObjectT,   class SourceObjectT, 
     335          class RefCountPolicyT, class RootObjectT   > 
     336OSG::ReferenceCountPointer<TargetObjectT, RefCountPolicyT, RootObjectT> 
     337const_pointer_cast(OSG::ReferenceCountPointer<SourceObjectT, 
     338                                               RefCountPolicyT, 
     339                                               RootObjectT     > const &source); 
     340 
     341template <class TargetObjectT,   class SourceObjectT, 
     342          class RefCountPolicyT, class RootObjectT   > 
     343OSG::ReferenceCountPointer<TargetObjectT, RefCountPolicyT, RootObjectT> 
    290344dynamic_pointer_cast(OSG::ReferenceCountPointer<SourceObjectT, 
    291345                                                RefCountPolicyT, 
    292                                                 RootObjectT     > const &source) 
    293 
    294     TargetObjectT *targetPtr = dynamic_cast<TargetObjectT *>(source.get()); 
    295     OSG::ReferenceCountPointer<TargetObjectT, 
    296                                RefCountPolicyT, 
    297                                RootObjectT     > returnValue(); 
    298      
    299     if(targetPtr != NULL) 
    300     { 
    301         returnValue.set(targetPtr); 
    302     } 
    303  
    304     return returnValue; 
    305 
     346                                                RootObjectT     > const &source); 
    306347           
    307348} // namespace boost 
    308349           
     350#include "OSGReferenceCountPointer.inl" 
     351 
    309352#endif // _OSGREFERENCECOUNTPOINTER_H_