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/OSGParallelComposerBase.cpp

    r1020 r1032  
    9494*/ 
    9595 
    96  
     96     
    9797void ParallelComposerBase::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>(&ParallelComposerBase::editHandleShort), 
    110         static_cast<FieldGetMethodSig >(&ParallelComposerBase::getHandleShort)); 
    111  
    112     oType.addInitialDesc(pDesc); 
    113  
     110        static_cast<FieldGetMethodSig >(&ParallelComposerBase::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>(&ParallelComposerBase::editHandleAlpha), 
    122         static_cast<FieldGetMethodSig >(&ParallelComposerBase::getHandleAlpha)); 
    123  
    124     oType.addInitialDesc(pDesc); 
    125  
     124        static_cast<FieldGetMethodSig >(&ParallelComposerBase::getHandleAlpha ) ); 
     125         
     126        oType.addInitialDesc(pDesc); 
     127         
     128         
    126129    pDesc = new SFString::Description( 
    127130        SFString::getClassType(), 
    128131        "pcLibPath", 
    129132        "", 
    130         PcLibPathFieldId, PcLibPathFieldMask, 
     133        PcLibPathFieldId, 
     134        PcLibPathFieldMask, 
    131135        false, 
    132136        Field::SFDefaultFlags, 
    133137        static_cast<FieldEditMethodSig>(&ParallelComposerBase::editHandlePcLibPath), 
    134         static_cast<FieldGetMethodSig >(&ParallelComposerBase::getHandlePcLibPath)); 
    135  
    136     oType.addInitialDesc(pDesc); 
    137 
    138  
     138        static_cast<FieldGetMethodSig >(&ParallelComposerBase::getHandlePcLibPath ) ); 
     139         
     140        oType.addInitialDesc(pDesc); 
     141         
     142         
     143
    139144 
    140145ParallelComposerBase::TypeObject ParallelComposerBase::_type( 
     
    192197    "" 
    193198    ); 
    194  
     199     
    195200/*------------------------------ get -----------------------------------*/ 
    196201 
     
    276281 
    277282//! create a new instance of the class 
    278 ParallelComposerPtr ParallelComposerBase::create(void) 
    279 
    280     ParallelComposerPtr fc; 
     283ParallelComposerBase::ObjRefPtr 
     284ParallelComposerBase::create(void) 
     285
     286    ObjRefPtr pFC; 
    281287 
    282288    if(getClassType().getPrototype() != NullFC) 
    283289    { 
    284         fc = dynamic_cast<ParallelComposer::ObjPtr>( 
    285             getClassType().getPrototype()-> shallowCopy()); 
    286     } 
    287  
    288     return fc
     290        pFC = boost::dynamic_pointer_cast<ParallelComposer>( 
     291            getClassType().getPrototype()->shallowCopy()); 
     292    } 
     293 
     294    return pFC
    289295} 
    290296 
     
    299305} 
    300306 
    301 FieldContainerPtr ParallelComposerBase::shallowCopy(void) const 
    302 
    303     ParallelComposerPtr returnValue; 
     307FieldContainerRefPtr 
     308ParallelComposerBase::shallowCopy(void) const 
     309
     310    ObjPtr returnValue; 
    304311 
    305312    newPtr(returnValue, dynamic_cast<const ParallelComposer *>(this)); 
    306313 
    307     return returnValue
     314    return FieldContainerRefPtr(returnValue)
    308315} 
    309316