示例#1
0
/*! constructor
 */
NFIOBase::BinaryReadHandler::BinaryReadHandler(std::istream &is) :
    BinaryDataHandler(1),
    _is(is)
{
    _readMemory.resize(8192);
    readBufAdd(&_readMemory[0], _readMemory.size());
}
示例#2
0
 TestHandler(FILE *file):OSG::BinaryDataHandler(15000),_file(file) {
     unsigned int i;
     _memory.resize(7*2);
     for(i=0;i<_memory.size();i+=2)
     {
         _memory[i  ].resize(15000);
         _memory[i+1].resize(15000);
         readBufAdd (&_memory[i  ][0],_memory[i  ].size());
         writeBufAdd(&_memory[i+1][0],_memory[i+1].size());
     }
 }
OSG_USING_NAMESPACE

/*-------------------------------------------------------------------------*/
/* OSBElementBase::BinaryReadHandler                                       */
/*-------------------------------------------------------------------------*/

/*! \class OSG::OSBElementBase::BinaryReadHandler
    Helper class for binary read operations.
 */

/*! \fn OSG::OSBElementBase::read(const std::string& typeName)
    Reads the object of type \a typeName and stores it as its container.

    \param[in] typeName Type of the object to read.
 */

/*! \fn OSG::OSBElementBase::postRead(void)
    Performs any post processing on the object read by this element. Usually
    this is used to perform conversions from older file formats and similar
    tasks.
 */

/*! \fn OSG::OSBElementBase::preWrite(const FieldContainerPtr& fc)
    Examines the FieldContainer \a fc and creates elements for all containers
    referenced by any of its fields and calls preWrite for these elements.
    This recursively traverses the part of the scene that can be reached from
    the root and records the objects to be written.

    \param[in] fc The container this element is processing.
 */

/*! \fn OSG::OSBElementBase::write(void)
    Writes the container it is responsible for.
 */

/*-------------------------------------------------------------------------*/
/* Constructor                                                             */

OSBElementBase::BinaryReadHandler::BinaryReadHandler(std::istream &inStream)
    : BinaryDataHandler(1       ),
      _readMemory      (8192    ),
      _is              (inStream)
{
    readBufAdd(&_readMemory[0], _readMemory.size());
}
BinFCFileType::BinaryFileHandler::BinaryFileHandler(std::istream *is) : _InputStream(is), _OutputStream(NULL)
{
	_Memory.resize(10000);
    readBufAdd(&_Memory[0], _Memory.size());
}