Show
Ignore:
Timestamp:
04/02/08 14:18:07 (8 months ago)
Author:
cneumann
Message:

replaced pointer field implementation
split FieldContainer/Fields? directory into Base and Handle subdir

Status: - ref counting seems to work (mt, cluster)

  • new OSB loader works (well, the unittest does)
  • VRML loader is deactivated
  • get/edit handle for dynamic (pointer) fields missing
  • need to remove some more old files - they get moved in this commit
  • generated (i.e. base) code in following commit
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/Carsten_PtrWork2/Source/Base/Base/OSGContainerForwards.h

    r1070 r1072  
    6464    typedef CLASST const *       NAME##ConstPtrArg 
    6565 
     66#define OSG_INHERIT_NAMED_PTR(BASECLASS, NAME)                    \ 
     67    typedef BASECLASS::NAME##Ptr            NAME##Ptr;            \ 
     68    typedef BASECLASS::NAME##PtrConst       NAME##PtrConst;       \ 
     69    typedef BASECLASS::NAME##ConstPtr       NAME##ConstPtr;       \ 
     70    typedef BASECLASS::NAME##ConstPtrConst  NAME##ConstPtrConst;  \ 
     71                                                                  \ 
     72    typedef BASECLASS::NAME##PtrArg         NAME##PtrArg;         \ 
     73    typedef BASECLASS::NAME##PtrConstArg    NAME##PtrConstArg;    \ 
     74    typedef BASECLASS::NAME##ConstPtrArg    NAME##ConstPtrArg 
     75     
     76#define OSG_INHERIT_NAMED_PTR_TMPL(BASECLASS, NAME)                        \ 
     77    typedef typename BASECLASS::NAME##Ptr            NAME##Ptr;            \ 
     78    typedef typename BASECLASS::NAME##PtrConst       NAME##PtrConst;       \ 
     79    typedef typename BASECLASS::NAME##ConstPtr       NAME##ConstPtr;       \ 
     80    typedef typename BASECLASS::NAME##ConstPtrConst  NAME##ConstPtrConst;  \ 
     81                                                                           \ 
     82    typedef typename BASECLASS::NAME##PtrArg         NAME##PtrArg;         \ 
     83    typedef typename BASECLASS::NAME##PtrConstArg    NAME##PtrConstArg;    \ 
     84    typedef typename BASECLASS::NAME##ConstPtrArg    NAME##ConstPtrArg 
     85     
    6686#define OSG_GEN_NAMED_P(CLASST, NAME)                       \ 
    6787    typedef CLASST       *       NAME##P;                   \ 
     
    185205 
    186206/*-------------------------------------------------------------------------*/ 
    187 /* ParentPtrWrapper<ObjectT>                                               */ 
    188 /*-------------------------------------------------------------------------*/ 
    189  
    190 template <class ObjectT> 
    191 class ParentPtrWrapper; 
    192      
    193 template <class ObjectT> 
    194 struct ParentPtrBuilder 
    195 { 
    196     typedef ParentPtrWrapper<ObjectT      >       Ptr; 
    197     typedef ParentPtrWrapper<ObjectT      > const PtrConst; 
    198     typedef ParentPtrWrapper<ObjectT const>       ConstPtr; 
    199     typedef ParentPtrWrapper<ObjectT const> const ConstPtrConst; 
    200 }; 
    201  
    202 /*-------------------------------------------------------------------------*/ 
    203207/* Pointer Types                                                           */ 
    204208/*-------------------------------------------------------------------------*/ 
     
    208212typedef InternalRefCountPtrBuilder<FieldContainer>::Ptr 
    209213    FieldContainerInternalRefPtr; 
    210 typedef ParentPtrBuilder          <FieldContainer>::Ptr 
    211     FieldContainerParentPtr; 
    212214typedef TransitPtrBuilder         <FieldContainer>::Ptr 
    213215    FieldContainerTransitPtr; 
     
    217219typedef InternalRefCountPtrBuilder<FieldContainerAttachment>::Ptr 
    218220    FieldContainerAttachmentInternalRefPtr; 
    219 typedef ParentPtrBuilder          <FieldContainerAttachment>::Ptr 
    220     FieldContainerAttachmentParentPtr; 
    221221     
    222222typedef RefCountPtrBuilder        <AttachmentContainer>::Ptr 
     
    224224typedef InternalRefCountPtrBuilder<AttachmentContainer>::Ptr 
    225225    AttachmentContainerInternalRefPtr; 
    226 typedef ParentPtrBuilder          <AttachmentContainer>::Ptr 
    227     AttachmentContainerParentPtr; 
    228226     
    229227typedef RefCountPtrBuilder        <Node>::Ptr NodeRefPtr; 
    230228typedef InternalRefCountPtrBuilder<Node>::Ptr NodeInternalRefPtr; 
    231 typedef ParentPtrBuilder          <Node>::Ptr NodeParentPtr; 
    232229     
    233230typedef RefCountPtrBuilder        <NodeCore>::Ptr NodeCoreRefPtr; 
    234231typedef InternalRefCountPtrBuilder<NodeCore>::Ptr NodeCoreInternalRefPtr; 
    235 typedef ParentPtrBuilder          <NodeCore>::Ptr NodeCoreParentPtr; 
    236232     
    237233OSG_GEN_CONTAINERPTR(FieldContainer); 
     
    241237OSG_GEN_CONTAINERPTR(NodeCore); 
    242238 
     239namespace detail 
     240{ 
     241    template <class TargetTypeT, class SourceTypeT> 
     242    TargetTypeT 
     243    void_cast(SourceTypeT source) 
     244    { 
     245        return static_cast<TargetTypeT>(static_cast<void *>(source)); 
     246    } 
     247     
     248} // namespace detail 
     249 
    243250template <class CoreT> 
    244251class CoredNodeRefPtr;