OpenSceneGraph 3.6.5
osgDB::InputStream Class Reference

#include <InputStream>

Public Types

enum  ReadType { READ_UNKNOWN = 0 , READ_SCENE , READ_IMAGE , READ_OBJECT }
typedef std::map< unsigned int, osg::ref_ptr< osg::Array > > ArrayMap
typedef std::map< unsigned int, osg::ref_ptr< osg::Object > > IdentifierMap

Public Member Functions

 InputStream (const osgDB::Options *options)
virtual ~InputStream ()
void setFileVersion (const std::string &d, int v)
int getFileVersion (const std::string &d=std::string()) const
bool isBinary () const
const osgDB::OptionsgetOptions () const
InputStreamoperator>> (bool &b)
InputStreamoperator>> (char &c)
InputStreamoperator>> (signed char &c)
InputStreamoperator>> (unsigned char &c)
InputStreamoperator>> (short &s)
InputStreamoperator>> (unsigned short &s)
InputStreamoperator>> (int &i)
InputStreamoperator>> (unsigned int &i)
InputStreamoperator>> (long &l)
InputStreamoperator>> (unsigned long &l)
InputStreamoperator>> (float &f)
InputStreamoperator>> (double &d)
InputStreamoperator>> (std::string &s)
InputStreamoperator>> (std::istream &(*fn)(std::istream &))
InputStreamoperator>> (std::ios_base &(*fn)(std::ios_base &))
InputStreamoperator>> (ObjectGLenum &value)
InputStreamoperator>> (ObjectProperty &prop)
InputStreamoperator>> (ObjectMark &mark)
InputStreamoperator>> (osg::Vec2b &v)
InputStreamoperator>> (osg::Vec3b &v)
InputStreamoperator>> (osg::Vec4b &v)
InputStreamoperator>> (osg::Vec2ub &v)
InputStreamoperator>> (osg::Vec3ub &v)
InputStreamoperator>> (osg::Vec4ub &v)
InputStreamoperator>> (osg::Vec2s &v)
InputStreamoperator>> (osg::Vec3s &v)
InputStreamoperator>> (osg::Vec4s &v)
InputStreamoperator>> (osg::Vec2us &v)
InputStreamoperator>> (osg::Vec3us &v)
InputStreamoperator>> (osg::Vec4us &v)
InputStreamoperator>> (osg::Vec2i &v)
InputStreamoperator>> (osg::Vec3i &v)
InputStreamoperator>> (osg::Vec4i &v)
InputStreamoperator>> (osg::Vec2ui &v)
InputStreamoperator>> (osg::Vec3ui &v)
InputStreamoperator>> (osg::Vec4ui &v)
InputStreamoperator>> (osg::Vec2f &v)
InputStreamoperator>> (osg::Vec3f &v)
InputStreamoperator>> (osg::Vec4f &v)
InputStreamoperator>> (osg::Vec2d &v)
InputStreamoperator>> (osg::Vec3d &v)
InputStreamoperator>> (osg::Vec4d &v)
InputStreamoperator>> (osg::Quat &q)
InputStreamoperator>> (osg::Plane &p)
InputStreamoperator>> (osg::Matrixf &mat)
InputStreamoperator>> (osg::Matrixd &mat)
InputStreamoperator>> (osg::BoundingBoxf &bb)
InputStreamoperator>> (osg::BoundingBoxd &bb)
InputStreamoperator>> (osg::BoundingSpheref &bs)
InputStreamoperator>> (osg::BoundingSphered &bs)
InputStreamoperator>> (osg::ref_ptr< osg::Image > &ptr)
InputStreamoperator>> (osg::ref_ptr< osg::Array > &ptr)
InputStreamoperator>> (osg::ref_ptr< osg::PrimitiveSet > &ptr)
template<typename T>
InputStreamoperator>> (osg::ref_ptr< T > &ptr)
bool matchString (const std::string &str)
void advanceToCurrentEndBracket ()
void readWrappedString (std::string &str)
void readCharArray (char *s, unsigned int size)
void readComponentArray (char *s, unsigned int numElements, unsigned int numComponentsPerElements, unsigned int componentSizeInBytes)
unsigned int readSize ()
osg::ref_ptr< osg::ArrayreadArray ()
osg::ref_ptr< osg::PrimitiveSetreadPrimitiveSet ()
osg::ref_ptr< osg::ImagereadImage (bool readFromExternal=true)
template<typename T>
osg::ref_ptr< T > readObjectOfType ()
osg::ref_ptr< osg::ObjectreadObject (osg::Object *existingObj=0)
osg::ref_ptr< osg::ObjectreadObjectFields (const std::string &className, unsigned int id, osg::Object *existingObj=0)
template<typename T>
osg::ref_ptr< T > readObjectFieldsOfType (const std::string &className, unsigned int id, osg::Object *existingObj=0)
void setInputIterator (InputIterator *ii)
 set an input iterator, used directly when not using InputStream with a traditional file related stream.
ReadType start (InputIterator *)
 start reading from InputStream treating it as a traditional file related stream, handles headers and versioning
void decompress ()
void readSchema (std::istream &fin)
void resetSchema ()
void throwException (const std::string &msg)
const InputExceptiongetException () const

Public Attributes

ObjectProperty PROPERTY
ObjectMark BEGIN_BRACKET
ObjectMark END_BRACKET

Protected Types

typedef std::map< std::string, int > VersionMap

Protected Member Functions

void checkStream ()
void setWrapperSchema (const std::string &name, const std::string &properties)
template<typename T>
void readArrayImplementation (T *a, unsigned int numComponentsPerElements, unsigned int componentSizeInBytes)

Protected Attributes

ArrayMap _arrayMap
IdentifierMap _identifierMap
VersionMap _domainVersionMap
int _fileVersion
bool _useSchemaData
bool _forceReadingImage
std::vector< std::string > _fields
osg::ref_ptr< InputIterator_in
osg::ref_ptr< InputException_exception
osg::ref_ptr< const osgDB::Options_options
osg::ref_ptr< osg::Object_dummyReadObject
std::stringstream * _dataDecompress

Member Typedef Documentation

◆ ArrayMap

typedef std::map< unsigned int, osg::ref_ptr<osg::Array> > osgDB::InputStream::ArrayMap

◆ IdentifierMap

typedef std::map< unsigned int, osg::ref_ptr<osg::Object> > osgDB::InputStream::IdentifierMap

◆ VersionMap

typedef std::map<std::string, int> osgDB::InputStream::VersionMap
protected

Member Enumeration Documentation

◆ ReadType

Enumerator
READ_UNKNOWN 
READ_SCENE 
READ_IMAGE 
READ_OBJECT 

Constructor & Destructor Documentation

◆ InputStream()

◆ ~InputStream()

virtual osgDB::InputStream::~InputStream ( )
virtual

Member Function Documentation

◆ advanceToCurrentEndBracket()

void osgDB::InputStream::advanceToCurrentEndBracket ( )
inline

References _in.

◆ checkStream()

◆ decompress()

void osgDB::InputStream::decompress ( )

◆ getException()

const InputException * osgDB::InputStream::getException ( ) const
inline

References _exception.

◆ getFileVersion()

int osgDB::InputStream::getFileVersion ( const std::string & d = std::string()) const

◆ getOptions()

const osgDB::Options * osgDB::InputStream::getOptions ( ) const
inline

References _options.

◆ isBinary()

◆ matchString()

◆ operator>>() [1/54]

InputStream & osgDB::InputStream::operator>> ( bool & b)
inline

References _in, checkStream(), and InputStream().

◆ operator>>() [2/54]

InputStream & osgDB::InputStream::operator>> ( char & c)
inline

References _in, checkStream(), and InputStream().

◆ operator>>() [3/54]

InputStream & osgDB::InputStream::operator>> ( double & d)
inline

References _in, checkStream(), and InputStream().

◆ operator>>() [4/54]

InputStream & osgDB::InputStream::operator>> ( float & f)
inline

References _in, checkStream(), and InputStream().

◆ operator>>() [5/54]

InputStream & osgDB::InputStream::operator>> ( int & i)
inline

References _in, checkStream(), and InputStream().

◆ operator>>() [6/54]

InputStream & osgDB::InputStream::operator>> ( long & l)
inline

References _in, checkStream(), and InputStream().

◆ operator>>() [7/54]

InputStream & osgDB::InputStream::operator>> ( ObjectGLenum & value)
inline

References _in, checkStream(), and InputStream().

◆ operator>>() [8/54]

InputStream & osgDB::InputStream::operator>> ( ObjectMark & mark)
inline

References _in, checkStream(), and InputStream().

◆ operator>>() [9/54]

InputStream & osgDB::InputStream::operator>> ( ObjectProperty & prop)
inline

References _in, checkStream(), and InputStream().

◆ operator>>() [10/54]

InputStream & osgDB::InputStream::operator>> ( osg::BoundingBoxd & bb)

References InputStream().

◆ operator>>() [11/54]

InputStream & osgDB::InputStream::operator>> ( osg::BoundingBoxf & bb)

References InputStream().

◆ operator>>() [12/54]

InputStream & osgDB::InputStream::operator>> ( osg::BoundingSphered & bs)

References InputStream().

◆ operator>>() [13/54]

InputStream & osgDB::InputStream::operator>> ( osg::BoundingSpheref & bs)

References InputStream().

◆ operator>>() [14/54]

InputStream & osgDB::InputStream::operator>> ( osg::Matrixd & mat)

References InputStream().

◆ operator>>() [15/54]

InputStream & osgDB::InputStream::operator>> ( osg::Matrixf & mat)

References InputStream().

◆ operator>>() [16/54]

InputStream & osgDB::InputStream::operator>> ( osg::Plane & p)

References InputStream().

◆ operator>>() [17/54]

InputStream & osgDB::InputStream::operator>> ( osg::Quat & q)

References InputStream().

◆ operator>>() [18/54]

InputStream & osgDB::InputStream::operator>> ( osg::ref_ptr< osg::Array > & ptr)
inline

◆ operator>>() [19/54]

InputStream & osgDB::InputStream::operator>> ( osg::ref_ptr< osg::Image > & ptr)
inline

References InputStream(), and readImage().

◆ operator>>() [20/54]

InputStream & osgDB::InputStream::operator>> ( osg::ref_ptr< osg::PrimitiveSet > & ptr)
inline

◆ operator>>() [21/54]

template<typename T>
InputStream & osgDB::InputStream::operator>> ( osg::ref_ptr< T > & ptr)
inline

◆ operator>>() [22/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec2b & v)

References InputStream().

◆ operator>>() [23/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec2d & v)

References InputStream().

◆ operator>>() [24/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec2f & v)

References InputStream().

◆ operator>>() [25/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec2i & v)

References InputStream().

◆ operator>>() [26/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec2s & v)

References InputStream().

◆ operator>>() [27/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec2ub & v)

References InputStream().

◆ operator>>() [28/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec2ui & v)

References InputStream().

◆ operator>>() [29/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec2us & v)

References InputStream().

◆ operator>>() [30/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec3b & v)

References InputStream().

◆ operator>>() [31/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec3d & v)

References InputStream().

◆ operator>>() [32/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec3f & v)

References InputStream().

◆ operator>>() [33/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec3i & v)

References InputStream().

◆ operator>>() [34/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec3s & v)

References InputStream().

◆ operator>>() [35/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec3ub & v)

References InputStream().

◆ operator>>() [36/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec3ui & v)

References InputStream().

◆ operator>>() [37/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec3us & v)

References InputStream().

◆ operator>>() [38/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec4b & v)

References InputStream().

◆ operator>>() [39/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec4d & v)

References InputStream().

◆ operator>>() [40/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec4f & v)

References InputStream().

◆ operator>>() [41/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec4i & v)

References InputStream().

◆ operator>>() [42/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec4s & v)

References InputStream().

◆ operator>>() [43/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec4ub & v)

References InputStream().

◆ operator>>() [44/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec4ui & v)

References InputStream().

◆ operator>>() [45/54]

InputStream & osgDB::InputStream::operator>> ( osg::Vec4us & v)

References InputStream().

◆ operator>>() [46/54]

InputStream & osgDB::InputStream::operator>> ( short & s)
inline

References _in, checkStream(), and InputStream().

◆ operator>>() [47/54]

InputStream & osgDB::InputStream::operator>> ( signed char & c)
inline

References _in, checkStream(), and InputStream().

◆ operator>>() [48/54]

InputStream & osgDB::InputStream::operator>> ( std::ios_base &(* fn )(std::ios_base &))
inline

References _in, checkStream(), and InputStream().

◆ operator>>() [49/54]

InputStream & osgDB::InputStream::operator>> ( std::istream &(* fn )(std::istream &))
inline

References _in, checkStream(), and InputStream().

◆ operator>>() [50/54]

InputStream & osgDB::InputStream::operator>> ( std::string & s)
inline

References _in, checkStream(), and InputStream().

◆ operator>>() [51/54]

InputStream & osgDB::InputStream::operator>> ( unsigned char & c)
inline

References _in, checkStream(), and InputStream().

◆ operator>>() [52/54]

InputStream & osgDB::InputStream::operator>> ( unsigned int & i)
inline

References _in, checkStream(), and InputStream().

◆ operator>>() [53/54]

InputStream & osgDB::InputStream::operator>> ( unsigned long & l)
inline

References _in, checkStream(), and InputStream().

◆ operator>>() [54/54]

InputStream & osgDB::InputStream::operator>> ( unsigned short & s)
inline

References _in, checkStream(), and InputStream().

◆ readArray()

osg::ref_ptr< osg::Array > osgDB::InputStream::readArray ( )

Referenced by operator>>().

◆ readArrayImplementation()

template<typename T>
void osgDB::InputStream::readArrayImplementation ( T * a,
unsigned int numComponentsPerElements,
unsigned int componentSizeInBytes )
protected

◆ readCharArray()

void osgDB::InputStream::readCharArray ( char * s,
unsigned int size )
inline

References _in.

◆ readComponentArray()

void osgDB::InputStream::readComponentArray ( char * s,
unsigned int numElements,
unsigned int numComponentsPerElements,
unsigned int componentSizeInBytes )
inline

References _in.

◆ readImage()

osg::ref_ptr< osg::Image > osgDB::InputStream::readImage ( bool readFromExternal = true)

◆ readObject()

osg::ref_ptr< osg::Object > osgDB::InputStream::readObject ( osg::Object * existingObj = 0)

Referenced by readObjectOfType().

◆ readObjectFields()

osg::ref_ptr< osg::Object > osgDB::InputStream::readObjectFields ( const std::string & className,
unsigned int id,
osg::Object * existingObj = 0 )

Referenced by readObjectFieldsOfType().

◆ readObjectFieldsOfType()

template<typename T>
osg::ref_ptr< T > osgDB::InputStream::readObjectFieldsOfType ( const std::string & className,
unsigned int id,
osg::Object * existingObj = 0 )
inline

◆ readObjectOfType()

template<typename T>
osg::ref_ptr< T > osgDB::InputStream::readObjectOfType ( )
inline

◆ readPrimitiveSet()

osg::ref_ptr< osg::PrimitiveSet > osgDB::InputStream::readPrimitiveSet ( )

Referenced by operator>>().

◆ readSchema()

void osgDB::InputStream::readSchema ( std::istream & fin)

◆ readSize()

unsigned int osgDB::InputStream::readSize ( )
inline

◆ readWrappedString()

void osgDB::InputStream::readWrappedString ( std::string & str)
inline

References _in, and checkStream().

Referenced by osgDB::StringSerializer< C >::read().

◆ resetSchema()

void osgDB::InputStream::resetSchema ( )

References throwException().

◆ setFileVersion()

void osgDB::InputStream::setFileVersion ( const std::string & d,
int v )
inline

References _domainVersionMap.

◆ setInputIterator()

void osgDB::InputStream::setInputIterator ( InputIterator * ii)
inline

set an input iterator, used directly when not using InputStream with a traditional file related stream.

References _in.

◆ setWrapperSchema()

void osgDB::InputStream::setWrapperSchema ( const std::string & name,
const std::string & properties )
protected

◆ start()

ReadType osgDB::InputStream::start ( InputIterator * )

start reading from InputStream treating it as a traditional file related stream, handles headers and versioning

◆ throwException()

void osgDB::InputStream::throwException ( const std::string & msg)
inline

References _exception, and _fields.

Referenced by checkStream(), and resetSchema().

Member Data Documentation

◆ _arrayMap

ArrayMap osgDB::InputStream::_arrayMap
protected

◆ _dataDecompress

std::stringstream* osgDB::InputStream::_dataDecompress
protected

◆ _domainVersionMap

VersionMap osgDB::InputStream::_domainVersionMap
protected

Referenced by setFileVersion().

◆ _dummyReadObject

osg::ref_ptr<osg::Object> osgDB::InputStream::_dummyReadObject
protected

◆ _exception

osg::ref_ptr<InputException> osgDB::InputStream::_exception
protected

Referenced by getException(), and throwException().

◆ _fields

std::vector<std::string> osgDB::InputStream::_fields
protected

Referenced by throwException().

◆ _fileVersion

int osgDB::InputStream::_fileVersion
protected

Referenced by operator>>(), and operator>>().

◆ _forceReadingImage

bool osgDB::InputStream::_forceReadingImage
protected

◆ _identifierMap

IdentifierMap osgDB::InputStream::_identifierMap
protected

◆ _in

◆ _options

osg::ref_ptr<const osgDB::Options> osgDB::InputStream::_options
protected

Referenced by getOptions().

◆ _useSchemaData

bool osgDB::InputStream::_useSchemaData
protected

◆ BEGIN_BRACKET

◆ END_BRACKET

◆ PROPERTY

ObjectProperty osgDB::InputStream::PROPERTY

The documentation for this class was generated from the following file:

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.