Show
Ignore:
Timestamp:
12/12/07 18:00:42 (9 months 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/OSGBinarySwapComposerBase.cpp

    r1020 r1032  
    9494*/ 
    9595 
    96  
     96     
    9797void BinarySwapComposerBase::classDescInserter(TypeObject &oType) 
    9898{ 
    9999    FieldDescriptionBase *pDesc = NULL; 
    100  
    101100 
    102101    pDesc = new SFBool::Description( 
     
    104103        "short", 
    105104        "", 
    106         ShortFieldId, ShortFieldMask, 
     105        ShortFieldId, 
     106        ShortFieldMask, 
    107107        false, 
    108108        Field::SFDefaultFlags, 
    109109        static_cast<FieldEditMethodSig>(&BinarySwapComposerBase::editHandleShort), 
    110         static_cast<FieldGetMethodSig >(&BinarySwapComposerBase::getHandleShort)); 
    111  
    112     oType.addInitialDesc(pDesc); 
    113  
     110        static_cast<FieldGetMethodSig >(&BinarySwapComposerBase::getHandleShort ) ); 
     111         
     112        oType.addInitialDesc(pDesc); 
     113         
     114         
    114115    pDesc = new SFBool::Description( 
    115116        SFBool::getClassType(), 
    116117        "alpha", 
    117118        "", 
    118         AlphaFieldId, AlphaFieldMask, 
     119        AlphaFieldId, 
     120        AlphaFieldMask, 
    119121        false, 
    120122        Field::SFDefaultFlags, 
    121123        static_cast<FieldEditMethodSig>(&BinarySwapComposerBase::editHandleAlpha), 
    122         static_cast<FieldGetMethodSig >(&BinarySwapComposerBase::getHandleAlpha)); 
    123  
    124     oType.addInitialDesc(pDesc); 
    125  
     124        static_cast<FieldGetMethodSig >(&BinarySwapComposerBase::getHandleAlpha ) ); 
     125         
     126        oType.addInitialDesc(pDesc); 
     127         
     128         
    126129    pDesc = new SFUInt32::Description( 
    127130        SFUInt32::getClassType(), 
    128131        "tileSize", 
    129132        "", 
    130         TileSizeFieldId, TileSizeFieldMask, 
     133        TileSizeFieldId, 
     134        TileSizeFieldMask, 
    131135        false, 
    132136        Field::SFDefaultFlags, 
    133137        static_cast<FieldEditMethodSig>(&BinarySwapComposerBase::editHandleTileSize), 
    134         static_cast<FieldGetMethodSig >(&BinarySwapComposerBase::getHandleTileSize)); 
    135  
    136     oType.addInitialDesc(pDesc); 
    137 
    138  
     138        static_cast<FieldGetMethodSig >(&BinarySwapComposerBase::getHandleTileSize ) ); 
     139         
     140        oType.addInitialDesc(pDesc); 
     141         
     142         
     143
    139144 
    140145BinarySwapComposerBase::TypeObject BinarySwapComposerBase::_type( 
     
    191196    "" 
    192197    ); 
    193  
     198     
    194199/*------------------------------ get -----------------------------------*/ 
    195200 
     
    275280 
    276281//! create a new instance of the class 
    277 BinarySwapComposerPtr BinarySwapComposerBase::create(void) 
    278 
    279     BinarySwapComposerPtr fc; 
     282BinarySwapComposerBase::ObjRefPtr 
     283BinarySwapComposerBase::create(void) 
     284
     285    ObjRefPtr pFC; 
    280286 
    281287    if(getClassType().getPrototype() != NullFC) 
    282288    { 
    283         fc = dynamic_cast<BinarySwapComposer::ObjPtr>( 
    284             getClassType().getPrototype()-> shallowCopy()); 
    285     } 
    286  
    287     return fc
     289        pFC = boost::dynamic_pointer_cast<BinarySwapComposer>( 
     290            getClassType().getPrototype()->shallowCopy()); 
     291    } 
     292 
     293    return pFC
    288294} 
    289295 
     
    298304} 
    299305 
    300 FieldContainerPtr BinarySwapComposerBase::shallowCopy(void) const 
    301 
    302     BinarySwapComposerPtr returnValue; 
     306FieldContainerRefPtr 
     307BinarySwapComposerBase::shallowCopy(void) const 
     308
     309    ObjPtr returnValue; 
    303310 
    304311    newPtr(returnValue, dynamic_cast<const BinarySwapComposer *>(this)); 
    305312 
    306     return returnValue
     313    return FieldContainerRefPtr(returnValue)
    307314} 
    308315