Show
Ignore:
Timestamp:
12/12/07 18:00:42 (1 year ago)
Author:
cneumann
Message:

added: generic interface
changed: factory functions return RefPtr?

The unittests don't pass right now, because of the change
to the factory functions, which leads to containers
being immediately destroyed as they are not assigned to
a RefPtr?.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/Carsten_PtrWork2/Source/System/Cluster/Window/SortLast/OSGPipelineComposerBase.cpp

    r1020 r1032  
    9898*/ 
    9999 
    100  
     100     
    101101void PipelineComposerBase::classDescInserter(TypeObject &oType) 
    102102{ 
    103103    FieldDescriptionBase *pDesc = NULL; 
    104  
    105104 
    106105    pDesc = new SFBool::Description( 
     
    108107        "short", 
    109108        "", 
    110         ShortFieldId, ShortFieldMask, 
     109        ShortFieldId, 
     110        ShortFieldMask, 
    111111        false, 
    112112        Field::SFDefaultFlags, 
    113113        static_cast<FieldEditMethodSig>(&PipelineComposerBase::editHandleShort), 
    114         static_cast<FieldGetMethodSig >(&PipelineComposerBase::getHandleShort)); 
    115  
    116     oType.addInitialDesc(pDesc); 
    117  
     114        static_cast<FieldGetMethodSig >(&PipelineComposerBase::getHandleShort ) ); 
     115         
     116        oType.addInitialDesc(pDesc); 
     117         
     118         
    118119    pDesc = new SFBool::Description( 
    119120        SFBool::getClassType(), 
    120121        "alpha", 
    121122        "", 
    122         AlphaFieldId, AlphaFieldMask, 
     123        AlphaFieldId, 
     124        AlphaFieldMask, 
    123125        false, 
    124126        Field::SFDefaultFlags, 
    125127        static_cast<FieldEditMethodSig>(&PipelineComposerBase::editHandleAlpha), 
    126         static_cast<FieldGetMethodSig >(&PipelineComposerBase::getHandleAlpha)); 
    127  
    128     oType.addInitialDesc(pDesc); 
    129  
     128        static_cast<FieldGetMethodSig >(&PipelineComposerBase::getHandleAlpha ) ); 
     129         
     130        oType.addInitialDesc(pDesc); 
     131         
     132         
    130133    pDesc = new SFUInt32::Description( 
    131134        SFUInt32::getClassType(), 
    132135        "tileSize", 
    133136        "", 
    134         TileSizeFieldId, TileSizeFieldMask, 
     137        TileSizeFieldId, 
     138        TileSizeFieldMask, 
    135139        false, 
    136140        Field::SFDefaultFlags, 
    137141        static_cast<FieldEditMethodSig>(&PipelineComposerBase::editHandleTileSize), 
    138         static_cast<FieldGetMethodSig >(&PipelineComposerBase::getHandleTileSize)); 
    139  
    140     oType.addInitialDesc(pDesc); 
    141  
     142        static_cast<FieldGetMethodSig >(&PipelineComposerBase::getHandleTileSize ) ); 
     143         
     144        oType.addInitialDesc(pDesc); 
     145         
     146         
    142147    pDesc = new SFBool::Description( 
    143148        SFBool::getClassType(), 
    144149        "pipelined", 
    145150        "", 
    146         PipelinedFieldId, PipelinedFieldMask, 
     151        PipelinedFieldId, 
     152        PipelinedFieldMask, 
    147153        false, 
    148154        Field::SFDefaultFlags, 
    149155        static_cast<FieldEditMethodSig>(&PipelineComposerBase::editHandlePipelined), 
    150         static_cast<FieldGetMethodSig >(&PipelineComposerBase::getHandlePipelined)); 
    151  
    152     oType.addInitialDesc(pDesc); 
    153 
    154  
     156        static_cast<FieldGetMethodSig >(&PipelineComposerBase::getHandlePipelined ) ); 
     157         
     158        oType.addInitialDesc(pDesc); 
     159         
     160         
     161
    155162 
    156163PipelineComposerBase::TypeObject PipelineComposerBase::_type( 
     
    216223    "" 
    217224    ); 
    218  
     225     
    219226/*------------------------------ get -----------------------------------*/ 
    220227 
     
    312319 
    313320//! create a new instance of the class 
    314 PipelineComposerPtr PipelineComposerBase::create(void) 
    315 
    316     PipelineComposerPtr fc; 
     321PipelineComposerBase::ObjRefPtr 
     322PipelineComposerBase::create(void) 
     323
     324    ObjRefPtr pFC; 
    317325 
    318326    if(getClassType().getPrototype() != NullFC) 
    319327    { 
    320         fc = dynamic_cast<PipelineComposer::ObjPtr>( 
    321             getClassType().getPrototype()-> shallowCopy()); 
    322     } 
    323  
    324     return fc
     328        pFC = boost::dynamic_pointer_cast<PipelineComposer>( 
     329            getClassType().getPrototype()->shallowCopy()); 
     330    } 
     331 
     332    return pFC
    325333} 
    326334 
     
    335343} 
    336344 
    337 FieldContainerPtr PipelineComposerBase::shallowCopy(void) const 
    338 
    339     PipelineComposerPtr returnValue; 
     345FieldContainerRefPtr 
     346PipelineComposerBase::shallowCopy(void) const 
     347
     348    ObjPtr returnValue; 
    340349 
    341350    newPtr(returnValue, dynamic_cast<const PipelineComposer *>(this)); 
    342351 
    343     return returnValue
     352    return FieldContainerRefPtr(returnValue)
    344353} 
    345354