Show
Ignore:
Timestamp:
01/16/08 16:07:40 (1 year ago)
Author:
cneumann
Message:

changed: - factory functions return a TransitPtr? that can not be implicitly

converted to C Ptr. Should help with porting.

added: - GlobalRefPtr?, needed for cases where upon return from main

a RefPtr? goes out of scope (it would attempt to access the
FCFactory which is already shutdown at that point).

status: - vrml loader does not compile (needs porting to ref ptr)

  • tutorials compile, run and exit cleanly
  • multithreading and cluster are untested, yet
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/Carsten_PtrWork2/Source/System/FileIO/OSB/OSGNFIOBase.cpp

    r1023 r1039  
    8787std::list<NFIOBase::fcInfo>     NFIOBase::_fieldList; 
    8888 
    89 std::list<FieldContainerPtr>    NFIOBase::_fcList; 
     89std::list<FieldContainerRefPtr> NFIOBase::_fcList; 
    9090std::set<UInt32>                NFIOBase::_fcSet; 
    9191//NFIOBase::IdMap                 NFIOBase::_ids; 
     
    118118* This is the main entry point for loading data with the osb loader. 
    119119*/ 
    120 NodePtr NFIOBase::read(std::istream &is, const std::string &options) 
     120NodeTransitPtr NFIOBase::read(std::istream &is, const std::string &options) 
    121121{ 
    122122    _options.init(options); 
     
    124124    _in = new BinaryReadHandler(is); 
    125125 
    126     NodePtr node = NullFC; 
    127  
    128     FieldContainerPtr fc = readFieldContainer(); 
    129     node = dynamic_cast<NodePtr>(fc); 
     126    NodeRefPtr node; 
     127 
     128    FieldContainerRefPtr fc = readFieldContainer(); 
     129     
     130    node = boost::dynamic_pointer_cast<Node>(fc); 
    130131 
    131132    delete _in; 
    132133 
    133     return node
     134    return NodeTransitPtr(node)
    134135} 
    135136 
     
    195196* Reads an entire "file" of binary data from the current binary reader. 
    196197*/ 
    197 FieldContainerPtr NFIOBase::readFieldContainer(void) 
     198FieldContainerTransitPtr NFIOBase::readFieldContainer(void) 
    198199{ 
    199200    FDEBUG(("NFIOBase::readFieldContainer\n")); 
     
    216217        FWARNING(("NFIOBase::readFieldContainer : Couldn't load file " 
    217218                  "this is not a OpenSG binary file!\n")); 
    218         return NullFC
     219        return FieldContainerTransitPtr()
    219220    } 
    220221 
     
    231232    std::string typeName; 
    232233    UInt32 id; 
    233     FieldContainerPtr root = NullFC
    234     FieldContainerPtr fc = NullFC
     234    FieldContainerRefPtr root
     235    FieldContainerRefPtr fc
    235236 
    236237    // Keep reading field containers until end of file 
     
    298299    SceneFileHandler::the()->updateReadProgress(100); 
    299300 
    300     return root
     301    return FieldContainerTransitPtr(root)
    301302} 
    302303 
     
    676677    // Note: list grows in reachability behind the scenes as side-effect of writeFC 
    677678    FieldContainerPtr lfc; 
    678     for(std::list<FieldContainerPtr>::iterator i = _fcList.begin(); 
     679    for(std::list<FieldContainerRefPtr>::iterator i = _fcList.begin(); 
    679680        i != _fcList.end(); ++i) 
    680681    { 
     
    889890    { 
    890891        _fcSet.insert(id); 
    891         _fcList.push_back(fc); 
     892        _fcList.push_back(FieldContainerRefPtr(fc)); 
    892893    } 
    893894}