NLMISC::IStream Class Reference

A IO stream interface. More...

#include <stream.h>

Inherited by NLMISC::CIFile, NLMISC::CIXml, NLMISC::CMemStream, NLMISC::COFile, and NLMISC::COXml.

List of all members.

Public Member Functions

 IStream (bool inputStream)
 Constructor.
virtual ~IStream ()
 Destructor.
 IStream (const IStream &other)
 Copy constructor.
IStreamoperator= (const IStream &other)
 Assignment operator.
void swap (IStream &other)
 exchange
bool isReading () const
 Is this stream a Read/Input stream?
bool isXML () const
template<class T >
void serial (T &obj)
 Template Object serialisation.
template<class T >
void serialEnum (T &em)
 Template enum serialisation. Serialized as a sint32.
template<class T >
void serialShortEnum (T &em)
 Template short enum serialisation. Serialized as a uint8 (with checking).
virtual void serialMemStream (CMemStream &b)
 Serial memstream, bitmemstream...
virtual void serialBufferWithSize (uint8 *buf, uint32 len)
 This method first serializes the size of the buffer and after the buffer itself, it enables the possibility to serial with a serialCont() on the other side.
Base type serialization.

Those method are a specialization of template method "void serial(T&)".



virtual void serial (uint8 &b)
virtual void serial (sint8 &b)
virtual void serial (uint16 &b)
virtual void serial (sint16 &b)
virtual void serial (uint32 &b)
virtual void serial (sint32 &b)
virtual void serial (uint64 &b)
virtual void serial (sint64 &b)
virtual void serial (float &b)
virtual void serial (double &b)
virtual void serial (bool &b)
virtual void serial (char &b)
virtual void serial (std::string &b)
virtual void serial (ucstring &b)
BitField serialisation.

Unlike other serial method, The reading bitfield is returned!! If !this->isReading(), bf is returned.

MUST use it simply like this: a= serialBitFieldX(a); // where X== 8, 16 or 32.

NB: Performance warning: the data is stored as an uint8, uint16 or uint32, according to the method you use.



uint8 serialBitField8 (uint8 bf)
 Serialisation of bitfield <=8 bits.
uint16 serialBitField16 (uint16 bf)
 Serialisation of bitfield <=16 bits.
uint32 serialBitField32 (uint32 bf)
 Serialisation of bitfield <=32 bits.
Multiple serialisation.

Template for easy multiple serialisation.



template<class T0 , class T1 >
void serial (T0 &a, T1 &b)
template<class T0 , class T1 , class T2 >
void serial (T0 &a, T1 &b, T2 &c)
template<class T0 , class T1 , class T2 , class T3 >
void serial (T0 &a, T1 &b, T2 &c, T3 &d)
template<class T0 , class T1 , class T2 , class T3 , class T4 >
void serial (T0 &a, T1 &b, T2 &c, T3 &d, T4 &e)
template<class T0 , class T1 , class T2 , class T3 , class T4 , class T5 >
void serial (T0 &a, T1 &b, T2 &c, T3 &d, T4 &e, T5 &f)
standard STL containers serialisation.

Thse variants suppose contained type is a NeL smart pointer.

Known Supported containers: map<> Support up to sint32 length containers.

See also:
serialCont() serialContPtr() serialContPolyPtr()


template<class T , class Allocator >
void serialCont (std::vector< T, Allocator > &cont)
template<class T >
void serialCont (std::list< T > &cont)
template<class T >
void serialCont (std::deque< T > &cont)
template<class T >
void serialCont (std::set< T > &cont)
template<class T >
void serialCont (std::multiset< T > &cont)
template<class K , class T >
void serialCont (std::map< K, T > &cont)
template<class K , class T , class H >
void serialCont (CHashMap< K, T, H > &cont)
template<class K , class T >
void serialCont (std::multimap< K, T > &cont)
template<class K , class T >
void serialPtrCont (std::map< K, T > &cont)
virtual void serialCont (std::vector< uint8 > &cont)
 Specialisation of serialCont() for vector<uint8>.
virtual void serialCont (std::vector< sint8 > &cont)
 Specialisation of serialCont() for vector<sint8>.
virtual void serialCont (std::vector< bool > &cont)
 Specialisation of serialCont() for vector<bool>.
standard STL containers serialisation. Elements must be pointers on a base type (uint...) or on a

object providing "void serial(IStream&)" method.

Known Supported containers: vector<>, list<>, deque<>, set<>, multiset<> Support up to sint32 length containers.

See also:
serialCont() serialContPolyPtr()


template<class T , class Allocator >
void serialContPtr (std::vector< T, Allocator > &cont)
template<class T >
void serialContPtr (std::list< T > &cont)
template<class T >
void serialContPtr (std::deque< T > &cont)
template<class T >
void serialContPtr (std::set< T > &cont)
template<class T >
void serialContPtr (std::multiset< T > &cont)
standard STL containers serialisation. Elements must be pointers on a IStreamable object.

Known Supported containers: vector<>, list<>, deque<>, set<>, multiset<> Support up to sint32 length containers.

See also:
serialCont() serialContPtr()


template<class T , class Allocator >
void serialContPolyPtr (std::vector< T, Allocator > &cont)
template<class T >
void serialContPolyPtr (std::list< T > &cont)
template<class T >
void serialContPolyPtr (std::deque< T > &cont)
template<class T >
void serialContPolyPtr (std::set< T > &cont)
template<class T >
void serialContPolyPtr (std::multiset< T > &cont)
template<class K , class T >
void serialContPolyPtr (std::map< K, T > &cont)
template<class T >
void serialPtr (T *&ptr)
 Serialize Non Polymorphic Objet Ptr.
template<class T >
void serialPolyPtr (T *&ptr)
 Serialize Polymorphic Objet Ptr.
uint serialVersion (uint currentVersion)
 Serialize a version number.
template<class T >
void serialCheck (const T &value)
 Serialize a check value.
XML user interface

Those functions are used to add information in your stream to structure it like a XML document.

Exemple of a serial sequence :

        // Start the opening of a new node named Identity
        stream.xmlPush ("Identity")

            // Serial some infos
            stream.serial (name);
            stream.serial (pseudo);

            // Open a new node header named Address
            stream.xmlPushBegin ("Address");

                    // Set a property name
                    stream.xmlSetAttrib ("Street")

                    // Serial the property
                    stream.serial ("Street");

                // Close the new node header
                stream.xmlPushEnd ();

                // Serial in this node
                stream.serial (cityName);

            // Close the address node
            stream.xmlPop ();

            // Add a comment
            stream.xmlComment ("Hello");

        // Close the identity node
        stream.xmlPop ();

The result will be an xml document structured like this:

        <Identity>
            Corvazier Hulud
            <Address Street="rue du Faubourg Saint Antoine">
                Paris
            <\Address>
            <!-- Hello -->
        <\Identity>

Node header serials are the serialisations done between xmlPushBegin() and xmlPushEnd() call. There is some restrictions on them: Node header serials are only available for basic types (numbers and strings). xmlSetAttrib() must be called before node header serial.

Note that XML documents only have ONE root node, so all serialisation must be done between a xmlPush() and a xmlPop() call.

When a xml input stream will try to open a node, it will scan all currrent child nodes to find the good one. So input xml stream can skip unknown node.



template<class T >
void xmlSerial (T &value0, const char *nodeName)
 xmlSerial() serial a values into a node.
template<class T >
void xmlSerial (T &value0, T &value1, const char *nodeName)
template<class T >
void xmlSerial (T &value0, T &value1, T &value2, const char *nodeName)
template<class T >
void xmlSerial (T &value0, T &value1, T &value2, T &value3, const char *nodeName)
is the name of the node to open

xmlPushBegin() open recurcively a new node and open its header.

You must call xmlPushEnd() to close the header and xmlPop() to close this node.

Returns:
true if you can open the node header, false if the stream is between a xmlPushBegin() and a xmlPushEnd() call.


bool xmlPush (const char *name)
bool xmlPushBegin (const char *name)
bool xmlPushEnd ()
 xmlPushEnd() close the node header.
bool xmlPop ()
 xmlPop() close the node.
bool xmlSetAttrib (const char *name)
 xmlSetAttrib() set the name of the next node header attribute serialised.
bool xmlBreakLine ()
 xmlBreakLine() insert a break line in the XML stream.
bool xmlComment (const char *comment)
 xmlComment() insert a comment line in the XML stream.

Static Public Member Functions

static void setVersionException (bool throwOnOlder, bool throwOnNewer)
 Set the behavior of IStream regarding input stream that are older/newer than the class.
static void getVersionException (bool &throwOnOlder, bool &throwOnNewer)
 Get the behavior of IStream regarding input stream that are older/newer than the class.
template<class T >
static Tunconst (const T &t)

Protected Member Functions

template<class T >
void serialVector (T &cont)
 special version for serializing a vector.

Private Types

typedef CHashMap< uint64, void * >
::iterator 
ItIdMap
typedef CHashMap< uint64, void * >
::value_type 
ValueIdMap

Private Member Functions

void serialIStreamable (IStreamable *&ptr)
template<class T >
void serialSTLContLen (T &cont, sint32 len)
 standard STL containers serialization.
template<class T >
void serialSTLCont (T &cont)
 standard STL containers serialisation.
template<class T >
void serialSTLContLenPtr (T &cont, sint32 len)
 standard STL containers serialisation.
template<class T >
void serialSTLContPtr (T &cont)
 standard STL containers serialisation.
template<class T >
void serialVectorPtr (T &cont)
 special version for serializing a vector.
template<class T >
void serialSTLContLenPolyPtr (T &cont, sint32 len)
 standard STL containers serialisation.
template<class T >
void serialMapContLenPolyPtr (T &cont, sint32 len)
 Map serialisation.
template<class T >
void serialSTLContPolyPtr (T &cont)
 standard STL containers serialisation.
template<class T >
void serialVectorPolyPtr (T &cont)
 special version for serializing a vector.
template<class K , class T >
void serialMapPolyPtr (std::map< K, T > &cont)
 special version for serializing a map.
template<class T >
void serialMultimap (T &cont)
 STL map<> and multimap<> serialisation.
template<class T >
void serialMap (T &cont)
 STL map<> Support up to sint32 length containers.
template<class T >
void serialPtrMap (T &cont)
 STL map<> Support up to sint32 length containers.

Private Attributes

bool _InputStream
uint32 _NextSerialPtrId
CHashMap< uint64, void * > _IdMap
bool _XML

Static Private Attributes

static bool _ThrowOnOlder = false
static bool _ThrowOnNewer = true

Seek fonctionnality



enum  TSeekOrigin { begin, current, end }
 

Parameters for seek().

More...
virtual bool seek (sint32 offset, TSeekOrigin origin) const
 Moves the stream pointer to a specified location.
virtual sint32 getPos () const
 Get the location of the stream pointer.
virtual std::string getStreamName () const
 Get a name for this stream.

XML implementation interface



virtual void serialBuffer (uint8 *buf, uint len)=0
 Method to be specified by the Deriver.
virtual void serialBit (bool &bit)=0
void setXMLMode (bool on)
 Set the XML mode.
virtual bool xmlPushBeginInternal (const char *)
 xmlPushBegin implementation
virtual bool xmlPushEndInternal ()
 xmlPushEnd implementation
virtual bool xmlPopInternal ()
 xmlPop implementation
virtual bool xmlSetAttribInternal (const char *)
 xmlBreakLine implementation
virtual bool xmlBreakLineInternal ()
 xmlBreakLine implementation
virtual bool xmlCommentInternal (const char *)
 xmlComment implementation
void resetPtrTable ()
 for Deriver: reset the PtrTable in the stream.
void setInOut (bool inputStream)
 Change, in live, the state of the inputStream.
virtual uint getDbgStreamSize () const
 Get the size for this stream.
void checkStreamSize (uint numBytes) const
 Elementarily check at least n bytes can be serialized from this stream (or throw EStreamOverflow).

Detailed Description

A IO stream interface.

This is the base interface for stream objects. Differents kind of streams may be implemented, by specifying serialBuffer() methods.

Deriver Use:

The deriver must:

Sample of streams: COutMemoryStream, CInFileStream ...

Client Use:

An object which can be serialized, must provide a "void serial(IStream &)" method. In this method, he can use any of the IStream method to help himself like:

The using is very simple as shown in this example:

 class A
 {
 public:
    float   x;
    uint32  y;
    Class1  a;      // this class must provide a serial() method too...
    Base    *c,*d;  // Base must derive from IStreamable
    vector<Class2>  tab;

 public:
    void    serial(IStream &f)
    {
        sint    streamver= f.serialVersion(3);
        f.serial(x,y,a);
        f.serialPtr(c);
        f.serialCont(tab);
        if(streamver>=2)
            f.serialPtr(d);
    }
 };

NB: YOU CANNOT use serial with a int / uint / sint type, since those type have unspecified length.

Author:
Lionel Berenguier
Vianney Lecroart
Nevrax France
Date:
2000

Definition at line 196 of file stream.h.


Member Typedef Documentation

typedef CHashMap<uint64, void*>::iterator NLMISC::IStream::ItIdMap [private]

Definition at line 984 of file stream.h.

typedef CHashMap<uint64, void*>::value_type NLMISC::IStream::ValueIdMap [private]

Definition at line 985 of file stream.h.


Member Enumeration Documentation

Parameters for seek().

begin seek from the begining of the stream. current seek from the current location of the stream pointer. end seek from the end of the stream.

Enumerator:
begin 
current 
end 

Definition at line 628 of file stream.h.


Constructor & Destructor Documentation

NLMISC::IStream::IStream ( bool  inputStream  )  [inline, explicit]

Constructor.

Notice that those behavior can be set at construction only.

Parameters:
inputStream is the stream an Input (read) stream?

Definition at line 48 of file stream_inline.h.

References _InputStream, _XML, and resetPtrTable().

virtual NLMISC::IStream::~IStream (  )  [inline, virtual]

Destructor.

Definition at line 225 of file stream.h.

NLMISC::IStream::IStream ( const IStream other  ) 

Copy constructor.

Definition at line 96 of file stream.cpp.

References _XML, and operator=().


Member Function Documentation

void NLMISC::IStream::checkStreamSize ( uint  numBytes  )  const [inline, protected]
virtual uint NLMISC::IStream::getDbgStreamSize (  )  const [inline, protected, virtual]

Get the size for this stream.

return 0 by default. Only implemented for input stream that know their size. Used internally to detect OverFlow with vector<> for instance

Reimplemented in NLMISC::CIFile, and NLMISC::CMemStream.

Definition at line 946 of file stream.h.

Referenced by checkStreamSize().

sint32 NLMISC::IStream::getPos ( void   )  const [virtual]

Get the location of the stream pointer.

NB: If the stream doesn't support the seek fonctionnality, it throw ESeekNotSupported. Default implementation: { throw ESeekNotSupported; }

Parameters:
offset is the wanted offset from the origin.
origin is the origin of the seek
Returns:
the new offset regarding from the origin.
See also:
ESeekNotSupported SeekOrigin seek

Reimplemented in NLMISC::CIFile, NLMISC::COFile, NLMISC::CMemStream, and NLNET::CMessage.

Definition at line 438 of file stream.cpp.

Referenced by NLSOUND::CMusicBufferVorbis::CMusicBufferVorbis(), NLMISC::CIXml::init(), NLMISC::CBitmap::readTGA(), NLSOUND::vorbisReadFunc(), and NLSOUND::vorbisTellFunc().

string NLMISC::IStream::getStreamName (  )  const [virtual]

Get a name for this stream.

maybe a fileName if FileStream. Default is to return "".

Reimplemented in NLMISC::CIFile, and NLMISC::COFile.

Definition at line 451 of file stream.cpp.

Referenced by NLMISC::EStream::EStream().

void NLMISC::IStream::getVersionException ( bool throwOnOlder,
bool throwOnNewer 
) [static]

Get the behavior of IStream regarding input stream that are older/newer than the class.

See also:
serialVersion() setVersionException()

Definition at line 85 of file stream.cpp.

References _ThrowOnNewer, and _ThrowOnOlder.

bool NLMISC::IStream::isReading (  )  const [inline]

Is this stream a Read/Input stream?

Definition at line 57 of file stream_inline.h.

References _InputStream.

Referenced by NLMISC::CBitMemStream::append(), NLNET::CMessage::assignFromSubMessage(), NLMISC::CMemStream::bufferToFill(), NL3D::CParticleSystemShape::buildFromPS(), NLNET::CMessage::clear(), NLMISC::CMemStream::clear(), NLNET::CMessage::CMessage(), NLNET::CTransportClass::createLocalRegisteredClassMessage(), NLPACS::UPrimitiveBlock::createPrimitiveBlock(), NLMISC::CBitMemStream::displayStream(), NLMISC::CMemStream::fastSerial(), NLMISC::CMemStream::fill(), NL3D::CParticleSystemShape::flushTextures(), NLMISC::CMemStream::getDbgStreamSize(), NLMISC::CBitMemStream::getSerialItem(), NLMISC::CBitMemStream::increaseBufferIfNecessary(), NLMISC::COXml::init(), NLMISC::CIXml::init(), NL3D::CParticleSystemShape::instanciatePS(), NLMISC::CBitMemStream::internalSerial(), NLNET::CMessage::invert(), NLMISC::CMemStream::invert(), NLMISC::CBitMemStream::invert(), NLNET::CMessage::length(), NLMISC::CMemStream::length(), NLMISC::CBitMemStream::length(), NLMISC::CBitmap::load(), NLMISC::CBitmap::loadSize(), NLMISC::CStringMapper::localSerialString(), NLNET::CMessage::lockSubMessage(), NLNET::CMessage::operator=(), NLMISC::CBitMemStream::pointNextByte(), NLMISC::CBitMemStream::poke(), NLMISC::CMemStream::poke(), NLMISC::CBitMemStream::pokeBits(), NLMISC::CBitMemStream::readBits(), NLMISC::CBitmap::readPNG(), NLMISC::CBitmap::readTGA(), NLNET::CMessage::readType(), NLNET::CMessage::readTypeAtCurrentPos(), NLMISC::CConfigFile::reparse(), NLMISC::CMemStream::reserve(), NLMISC::CBitMemStream::reserveBits(), NLMISC::CBitMemStream::resetBufPos(), NLPACS::CGlobalRetriever::CLrLoader::run(), NLNET::CStandardGateway::sendModuleMessage(), NLSOUND::CSoundSerializer::serial(), NLSOUND::CSound::serial(), NLSOUND::CSimpleSound::serial(), NLSOUND::CContextSound::serial(), NLSOUND::CComplexSound::serial(), NLSOUND::CSoundGroupSerializer::serial(), NLSOUND::CBackgroundSoundManager::TFxZone::serial(), NLSOUND::CBackgroundSoundManager::TSoundData::serial(), NLSOUND::CBackgroundSound::TSoundInfo::serial(), NLSOUND::CBackgroundSound::serial(), NLSOUND::CAudioMixerUser::CControledSources::serial(), NLPACS::CSurfaceQuadTree::serial(), NLPACS::CQuadBranch::serial(), NLPACS::CRetrieverInstance::serial(), NLPACS::CRetrieverBank::serial(), NLPACS::CGlobalRetriever::serial(), NLPACS::CEdgeQuad::serial(), NLPACS::CChainQuad::serial(), NLPACS::COrderedChain::serial(), NLNET::TSecurityDataDesc::serial(), NLNET::CInetAddress::serial(), NLMISC::COXml::serial(), NLMISC::CMatrix::serial(), NLMISC::CIXml::serial(), NLMISC::CEntityIdTranslator::CEntity::serial(), NLMISC::CBitSet::serial(), NLMISC::CBitMemStream::serial(), NLMISC::CAABBoxExt::serial(), NLLIGO::CPrimitives::serial(), NLLIGO::IPrimitive::serial(), NL3D::CZone::serial(), NL3D::CVegetableShape::serial(), NL3D::CTileVegetableDesc::serial(), NL3D::CInstanceGroup::serial(), NL3D::CInstanceGroup::CInstance::serial(), NL3D::CPortal::serial(), NL3D::CPointLightNamed::serial(), NL3D::CPointLight::serial(), NL3D::CPatch::serial(), NL3D::CMeshMRMSkinnedGeom::serial(), NL3D::CMaterial::serial(), NL3D::CLodCharacterShape::serial(), NL3D::CLodCharacterShapeBuild::serial(), NL3D::CIndexBuffer::serial(), NL3D::CHLSTextureBank::serial(), NL3D::CCluster::serial(), NL3D::CMaterialBase::CAnimatedTexture::serial(), NLNET::TBinBuffer::serial(), NLNET::CModuleMessageHeaderCodec::serial(), NLNET::TMessageRecord::serial(), NLNET::CMessage::TFormat::serial(), NLNET::CLoginCookie::serial(), serial(), NLMISC::CObjectVector< sint8, false >::serial(), NLMISC::CMemStream::serial(), NL3D::CSurfaceLightGrid::CCellCorner::serial(), NL3D::CPSAttrib< T >::serial(), NLMISC::CMemStream::serialBit(), NLMISC::CBitMemStream::serialBit(), NLMISC::CMemStream::serialBuffer(), NLMISC::CBitMemStream::serialBuffer(), serialCheck(), serialCont(), NLMISC::CBitMemStream::serialCont(), serialEnum(), NL3D::CVertexBuffer::serialHeader(), NLMISC::CMemStream::serialHex(), serialIStreamable(), NL3D::CMeshMRMGeom::serialLodVertexData(), serialMap(), serialMapContLenPolyPtr(), serialMapPolyPtr(), serialMemStream(), NLMISC::CBitMemStream::serialMemStream(), NLNET::CMessage::serialMessage(), serialMultimap(), NL3D::CVertexBuffer::serialOldV1Minus(), NL3D::CVectorPacker::serialPackedVector16(), serialPtr(), serialPtrMap(), NLMISC::CMemStream::serialSeparatedBufferIn(), NLMISC::CIXml::serialSeparatedBufferIn(), NLMISC::COXml::serialSeparatedBufferOut(), NLMISC::CMemStream::serialSeparatedBufferOut(), serialShortEnum(), serialSTLCont(), serialSTLContLen(), serialSTLContLenPolyPtr(), serialSTLContLenPtr(), serialSTLContPolyPtr(), serialSTLContPtr(), NL3D::CVertexBuffer::serialSubset(), serialVector(), serialVectorPolyPtr(), serialVectorPtr(), serialVersion(), NLNET::CMessage::setType(), NLNET::CMessage::unlockSubMessage(), NLSOUND::vorbisReadFunc(), NLNET::CTransportClass::write(), NLMISC::CBitmap::writePNG(), NLMISC::CBitmap::writeTGA(), NLSOUND::IBuffer::writeWav(), NLMISC::COXml::xmlBreakLineInternal(), NLMISC::COXml::xmlCommentInternal(), NLMISC::COXml::xmlPopInternal(), NLMISC::CIXml::xmlPopInternal(), NLMISC::COXml::xmlPushBeginInternal(), NLMISC::CIXml::xmlPushBeginInternal(), NLMISC::COXml::xmlPushEndInternal(), NLMISC::CIXml::xmlPushEndInternal(), NLMISC::COXml::xmlSetAttribInternal(), and NLMISC::CIXml::xmlSetAttribInternal().

bool NLMISC::IStream::isXML (  )  const [inline]

Definition at line 240 of file stream.h.

References _XML.

Referenced by NLMISC::CMemStream::serial().

IStream & NLMISC::IStream::operator= ( const IStream other  ) 

Assignment operator.

Reimplemented in NLMISC::CBitMemStream, NLMISC::CMemStream, NLMISC::CStringStream, and NLNET::CMessage.

Definition at line 108 of file stream.cpp.

References _InputStream, and resetPtrTable().

Referenced by IStream().

void NLMISC::IStream::resetPtrTable (  )  [protected]

for Deriver: reset the PtrTable in the stream.

If Derived stream provide reset()-like methods, they must call this method in their reset() methods. For example, CFile::close() must call it, so it will work correctly with next serialPtr()

Reimplemented in NLMISC::CMemStream.

Definition at line 270 of file stream.cpp.

References _IdMap, and _NextSerialPtrId.

Referenced by NLMISC::CIFile::close(), NLMISC::COXml::init(), NLMISC::COFile::internalClose(), IStream(), operator=(), and NLMISC::CIXml::release().

bool NLMISC::IStream::seek ( sint32  offset,
TSeekOrigin  origin 
) const [virtual]

Moves the stream pointer to a specified location.

NB: If the stream doesn't support the seek fonctionnality, it throw ESeekNotSupported. Default implementation: { throw ESeekNotSupported; }

Parameters:
offset is the wanted offset from the origin.
origin is the origin of the seek
Returns:
true if seek sucessfull.
See also:
ESeekNotSupported SeekOrigin getPos

Reimplemented in NLMISC::CIFile, NLMISC::COFile, and NLMISC::CMemStream.

Definition at line 433 of file stream.cpp.

Referenced by NLSOUND::CMusicBufferVorbis::CMusicBufferVorbis(), NLMISC::CIXml::init(), NLMISC::CBitmap::load(), NL3D::CMeshMRMGeom::loadNextLod(), NLMISC::CBitmap::loadSize(), NLMISC::CBitmap::readDDS(), NLMISC::CBitmap::readTGA(), and NLSOUND::vorbisSeekFunc().

template<class T0 , class T1 , class T2 , class T3 , class T4 , class T5 >
void NLMISC::IStream::serial ( T0 &  a,
T1 &  b,
T2 &  c,
T3 &  d,
T4 &  e,
T5 &  f 
) [inline]

Reimplemented in NLMISC::CMemStream, and NLMISC::CStringStream.

Definition at line 379 of file stream.h.

References serial().

Referenced by serial().

template<class T0 , class T1 , class T2 , class T3 , class T4 >
void NLMISC::IStream::serial ( T0 &  a,
T1 &  b,
T2 &  c,
T3 &  d,
T4 &  e 
) [inline]

Reimplemented in NLMISC::CMemStream, and NLMISC::CStringStream.

Definition at line 376 of file stream.h.

References serial().

Referenced by serial().

template<class T0 , class T1 , class T2 , class T3 >
void NLMISC::IStream::serial ( T0 &  a,
T1 &  b,
T2 &  c,
T3 &  d 
) [inline]

Reimplemented in NLMISC::CMemStream, and NLMISC::CStringStream.

Definition at line 373 of file stream.h.

References serial().

Referenced by serial().

template<class T0 , class T1 , class T2 >
void NLMISC::IStream::serial ( T0 &  a,
T1 &  b,
T2 &  c 
) [inline]

Reimplemented in NLMISC::CMemStream, and NLMISC::CStringStream.

Definition at line 370 of file stream.h.

References serial().

Referenced by serial().

template<class T0 , class T1 >
void NLMISC::IStream::serial ( T0 &  a,
T1 &  b 
) [inline]

Reimplemented in NLMISC::CMemStream, and NLMISC::CStringStream.

Definition at line 367 of file stream.h.

References serial().

Referenced by serial().

void NLMISC::IStream::serial ( ucstring b  )  [inline, virtual]
void NLMISC::IStream::serial ( std::string &  b  )  [inline, virtual]
void NLMISC::IStream::serial ( char &  b  )  [inline, virtual]
void NLMISC::IStream::serial ( bool b  )  [inline, virtual]
void NLMISC::IStream::serial ( double b  )  [inline, virtual]
void NLMISC::IStream::serial ( float b  )  [inline, virtual]
void NLMISC::IStream::serial ( sint64 b  )  [inline, virtual]
void NLMISC::IStream::serial ( uint64 b  )  [inline, virtual]
void NLMISC::IStream::serial ( sint32 b  )  [inline, virtual]
void NLMISC::IStream::serial ( uint32 b  )  [inline, virtual]
void NLMISC::IStream::serial ( sint16 b  )  [inline, virtual]
void NLMISC::IStream::serial ( uint16 b  )  [inline, virtual]
void NLMISC::IStream::serial ( sint8 b  )  [inline, virtual]
void NLMISC::IStream::serial ( uint8 b  )  [inline, virtual]
template<class T >
void NLMISC::IStream::serial ( T obj  )  [inline]

Template Object serialisation.

Parameters:
obj any object providing a "void serial(IStream&)" method. The object doesn't have to derive from IStreamable.

the VC++ error "error C2228: left of '.serial' must have class/struct/union type" means you don't provide a serial() method to your object. Or you may have use serial with a int / uint / sint type. REMEMBER YOU CANNOT do this, since those type have unspecified length.

Reimplemented in NLMISC::CBitMemStream, NLMISC::CMemStream, and NLMISC::CStringStream.

Definition at line 251 of file stream.h.

Referenced by NL3D::CAnimationSetUser::addAnimation(), NL3D::CAnimationSetUser::addSkeletonWeight(), NLSOUND::CAudioMixerUser::buildSampleBankList(), NLNET::cbExecCommand(), NLMISC::CEntityId::CEntityId(), NL3D::UAnimation::createAnimation(), NLPACS::UGlobalRetriever::createGlobalRetriever(), NLPACS::URetrieverBank::createRetrieverBank(), NLSOUND::CSampleBank::load(), NLSOUND::CBackgroundSoundManager::load(), NLMISC::CBitmap::load(), NL3D::CShapeBank::load(), NLMISC::CEntityId::load(), NLPACS::CMoveContainer::loadCollisionablePrimitiveBlock(), NL3D::CMeshMRMGeom::loadFirstLod(), loadForm(), loadForm2(), NL3D::CDriverUser::loadHLSBank(), NL3D::CMeshMRMGeom::loadNextLod(), NLPACS::CRetrieverBank::loadRetriever(), NLMISC::CBitmap::loadSize(), NL3D::CTileSet::loadTileVegetableDesc(), NLMISC::CStringMapper::localSerialString(), NLMISC::CBitmap::readDDS(), NLMISC::CBitmap::readTGA(), NL3D::CAsyncFileManager3D::CMeshLoad::run(), NLMISC::CEntityId::save(), NLPACS::CRetrieverBank::saveRetrievers(), NLSOUND::CSound::serial(), NLSOUND::CSimpleSound::serial(), NLSOUND::CMusicSound::serial(), NLSOUND::CContextSound::serial(), NLSOUND::CComplexSound::serial(), NLSOUND::CSoundGroupSerializer::serial(), NLSOUND::CBackgroundSoundManager::TFxZone::serial(), NLSOUND::CBackgroundSoundManager::TSoundData::serial(), NLSOUND::CBackgroundSoundManager::TBanksData::serial(), NLSOUND::CBackgroundSound::TSoundInfo::serial(), NLSOUND::CAudioMixerUser::CControledSources::serial(), NLPACS::CVector2s::serial(), NLPACS::IQuadNode::serial(), NLPACS::CSurfaceQuadTree::serial(), NLPACS::CQuadBranch::serial(), NLPACS::CRetrieverInstance::CLink::serial(), NLPACS::CRetrieverInstance::serial(), NLPACS::CRetrieverBank::serial(), NLPACS::CRetrievableSurface::CSurfaceLink::serial(), NLPACS::CRetrievableSurface::TLoop::serial(), NLPACS::CRetrievableSurface::serial(), NLPACS::CPrimitiveDesc::serial(), NLPACS::UTriggerInfo::serial(), NLPACS::UCollisionDesc::serial(), NLPACS::CLocalRetriever::CInteriorFace::serial(), NLPACS::CLocalRetriever::CTip::serial(), NLPACS::CLocalRetriever::CTip::CChainTip::serial(), NLPACS::CLocalRetriever::serial(), NLPACS::CGlobalRetriever::serial(), NLPACS::CFaceGrid::serial(), NLPACS::CExteriorMesh::CLink::serial(), NLPACS::CExteriorMesh::COrderedEdges::serial(), NLPACS::CExteriorMesh::CEdge::serial(), NLPACS::CExteriorMesh::serial(), NLPACS::CEdgeQuad::serial(), NLPACS::CExteriorEdgeEntry::serial(), NLPACS::CCollisionFace::serial(), NLPACS::CSurfaceIdent::serial(), NLPACS::CChainQuad::serial(), NLPACS::CChain::serial(), NLPACS::COrderedChain::serial(), NLPACS::COrderedChain3f::serial(), NLNET::TTransportDesc::serial(), NLNET::TModuleOperationMsg::serial(), NLNET::TModuleDistanceChangeMsg::serial(), NLNET::CInetAddress::serial(), NLMISC::CBGRA::serial(), NLMISC::CRGBA::serial(), NLMISC::CNoiseColorGradient::serial(), NLMISC::CNoiseValue::serial(), NLMISC::CMatrix::serial(), NLMISC::CIXml::serial(), NLMISC::CEntityIdTranslator::CEntity::serial(), NLMISC::CBitSet::serial(), NLMISC::CAABBox::serial(), NLLIGO::CPrimitives::serial(), NLLIGO::CPrimAlias::serial(), NLLIGO::IPrimitive::serial(), NLLIGO::CPrimRegion::serial(), NLLIGO::CPrimPoint::serial(), NL3D::CZone::serial(), NL3D::CZone::CPatchConnect::serial(), NL3D::CPaletteSkin::serial(), NL3D::CVegetableShape::serial(), NL3D::CVegetable::serial(), NL3D::CTrackSampledVector::serial(), NL3D::CTrackSampledQuat::serial(), NL3D::CTrackSampledCommon::CTimeBlock::serial(), NL3D::CTileVegetableDesc::serial(), NL3D::CTileLightInfluence::serial(), NL3D::CTileNoise::serial(), NL3D::CSurfaceLightGrid::serial(), NL3D::CSkeletonWeight::CNode::serial(), NL3D::CInstanceGroup::serial(), NL3D::CInstanceGroup::CInstance::serial(), NL3D::CPortal::serial(), NL3D::CPointLightNamed::serial(), NL3D::CPointLight::serial(), NL3D::CPatch::serial(), NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::serial(), NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::serial(), NL3D::CMeshMRMSkinnedGeom::serial(), NL3D::CMaterial::CLightMap::serial(), NL3D::CMaterial::serial(), NL3D::CLodCharacterTexture::serial(), NL3D::CLodCharacterShape::serial(), NL3D::CLodCharacterShape::CBoneInfluence::serial(), NL3D::CLodCharacterShape::CAnim::serial(), NL3D::CLodCharacterShapeBuild::serial(), NL3D::CIndexBuffer::serial(), NL3D::CIGSurfaceLight::serial(), NL3D::CHLSTextureBank::CTextureInstance::serial(), NL3D::CHLSColorTexture::serial(), NL3D::CHLSColorTexture::CMask::serial(), NL3D::CHLSColorDelta::serial(), NL3D::CCluster::serial(), NL3D::CCameraInfo::serial(), NL3D::CBoneBase::serial(), NL3D::CAnimationPlaylist::serial(), NL3D::CAnimation::serial(), NL3D::CMorphBase::serial(), NL3D::CMaterialBase::serial(), NLSOUND::UAudioMixer::TBackgroundFlags::serial(), NLNET::TServiceId8::serial(), NLNET::TServiceId::serial(), NLNET::TBinBuffer::serial(), NLNET::CMessage::TFormat::serial(), NLNET::CLoginCookie::serial(), NLMISC::CVectorD::serial(), NLMISC::CVector::serial(), NLMISC::CVector2f::serial(), NLMISC::CVector2d::serial(), NLMISC::CUVW::serial(), NLMISC::CUV::serial(), serial(), NLMISC::CSString::serial(), CHashKey::serial(), NLMISC::CQuatT< float >::serial(), NLMISC::CAngleAxis::serial(), NLMISC::CPlane::serial(), NLMISC::CObjectVector< sint8, false >::serial(), NLMISC::CEnumBitset< EnumType, BitsetType, maxValue, Delimiter, EnumAccessor, SimpleEnumType >::serial(), NLMISC::CSerialCommand::serial(), NLLIGO::CPrimVector::serial(), NL3D::CQuatPack::serial(), NL3D::CSurfaceLightGrid::CCellCorner::serial(), NL3D::CShadowVertex::serial(), NL3D::CPSAttrib< T >::serial(), NL3D::CPointLightNamedArray::CPointLightGroupV0::serial(), NL3D::CPointLightNamedArray::CPointLightGroup::serial(), NL3D::CVector3s::serial(), NL3D::CMRMWedgeGeom::serial(), NL3D::CMeshMRMSkinnedGeom::CVertexBlock::serial(), NL3D::CMeshMRMSkinnedGeom::CRdrPass::serial(), NL3D::CMeshMRMGeom::CLodInfo::serial(), NL3D::CMeshMRMGeom::CVertexBlock::serial(), NL3D::CMeshMRMGeom::CRdrPass::serial(), NL3D::CMeshBase::CLightMapInfoList::serial(), NL3D::CMeshBase::CLightMapInfoList::CMatStage::serial(), NL3D::CMeshBase::CMatStageV7::serial(), NL3D::CMeshGeom::CMatrixBlock::serial(), NL3D::CMeshGeom::CRdrPass::serial(), NL3D::CMaterial::CTexEnv::serial(), NL3D::CLodCharacterTexture::CTUVQ::serial(), NL3D::CLodCharacterShape::CVertexInf::serial(), NL3D::CLodCharacterShape::CVector3s::serial(), NL3D::CLodCharacterShapeBuild::CPixelInfo::serial(), NL3D::CIGSurfaceLight::CRetrieverLightGrid::serial(), NL3D::CMaterialBase::CTexAnimTracks::serial(), NL3D::CMaterial::CLightMap::serial2(), serialBitField16(), serialBitField32(), serialBitField8(), serialBufferWithSize(), serialCheck(), NL3D::CTrackSampledCommon::serialCommon(), serialCont(), NLNET::CTransportClass::CRegisteredProp< T >::serialDefaultValue(), serialEnum(), NL3D::CVertexBuffer::serialHeader(), serialIStreamable(), NL3D::CMeshMRMGeom::serialLodVertexData(), serialMap(), serialMapContLenPolyPtr(), serialMapPolyPtr(), serialMemStream(), serialMultimap(), NL3D::CVertexBuffer::serialOldV1Minus(), serialPtr(), serialPtrMap(), serialShortEnum(), serialSTLCont(), serialSTLContLen(), serialSTLContPolyPtr(), serialSTLContPtr(), NLNET::CTransportClass::CRegisteredProp< T >::serialValue(), serialVector(), serialVectorPolyPtr(), serialVectorPtr(), serialVersion(), NLMISC::CI18N::writeTextFile(), NLMISC::CBitmap::writeTGA(), NLSOUND::IBuffer::writeWav(), and xmlSerial().

virtual void NLMISC::IStream::serialBit ( bool bit  )  [pure virtual]
uint16 NLMISC::IStream::serialBitField16 ( uint16  bf  )  [inline]

Serialisation of bitfield <=16 bits.

Definition at line 337 of file stream_inline.h.

References serial().

uint32 NLMISC::IStream::serialBitField32 ( uint32  bf  )  [inline]

Serialisation of bitfield <=32 bits.

Definition at line 343 of file stream_inline.h.

References serial().

uint8 NLMISC::IStream::serialBitField8 ( uint8  bf  )  [inline]

Serialisation of bitfield <=8 bits.

Definition at line 331 of file stream_inline.h.

References serial().

Referenced by NL3D::CMaterial::CTexEnv::serial().

virtual void NLMISC::IStream::serialBuffer ( uint8 buf,
uint  len 
) [pure virtual]
virtual void NLMISC::IStream::serialBufferWithSize ( uint8 buf,
uint32  len 
) [inline, virtual]

This method first serializes the size of the buffer and after the buffer itself, it enables the possibility to serial with a serialCont() on the other side.

Definition at line 970 of file stream.h.

References serial(), and serialBuffer().

Referenced by NLNET::TBinBuffer::serial().

template<class T >
void NLMISC::IStream::serialCheck ( const T value  )  [inline]

Serialize a check value.

An object can stream a check value to check integrity or format of filed or streamed data. Just call serial check with a const value. Write will serial the value. Read will check the value is the same. If it is not, it will throw EInvalidDataStream exception.

NB: The type of the value must implement an operator == and must be serializable.

Parameters:
value the value used to the check.
See also:
EInvalidDataStream

Definition at line 599 of file stream.h.

References isReading(), serial(), xmlPop(), and xmlPush().

Referenced by NLNET::cbPacsAnswer(), NLNET::CPacsClient::initMessage(), loadForm(), loadForm2(), NLMISC::CBitmap::loadSize(), NLSOUND::CAudioMixerUser::TSampleBankHeader::serial(), NLPACS::CPrimitiveBlock::serial(), NLLIGO::CZoneTemplate::serial(), NLLIGO::CZoneRegion::serial(), NLLIGO::CTransition::serial(), NLLIGO::CPrimRegion::serial(), NLLIGO::CMaterial::serial(), NL3D::CZone::serial(), NL3D::CVegetableShape::serial(), NL3D::CSkeletonWeight::serial(), NL3D::CInstanceGroup::serial(), NL3D::CLodCharacterShape::serial(), NL3D::CLodCharacterShapeBuild::serial(), NL3D::CAnimationSet::serial(), and NL3D::CAnimation::serial().

void NLMISC::IStream::serialCont ( std::vector< bool > &  cont  )  [virtual]

Specialisation of serialCont() for vector<bool>.

Reimplemented in NLMISC::CBitMemStream, NLMISC::CMemStream, and NLMISC::CStringStream.

Definition at line 383 of file stream.cpp.

References checkStreamSize(), isReading(), serial(), and serialBuffer().

void NLMISC::IStream::serialCont ( std::vector< sint8 > &  cont  )  [virtual]

Specialisation of serialCont() for vector<sint8>.

Reimplemented in NLMISC::CBitMemStream, NLMISC::CMemStream, and NLMISC::CStringStream.

Definition at line 359 of file stream.cpp.

References checkStreamSize(), isReading(), serial(), and serialBuffer().

void NLMISC::IStream::serialCont ( std::vector< uint8 > &  cont  )  [virtual]

Specialisation of serialCont() for vector<uint8>.

Reimplemented in NLMISC::CBitMemStream, NLMISC::CMemStream, and NLMISC::CStringStream.

Definition at line 335 of file stream.cpp.

References checkStreamSize(), isReading(), serial(), and serialBuffer().

template<class K , class T >
void NLMISC::IStream::serialCont ( std::multimap< K, T > &  cont  )  [inline]

Reimplemented in NLMISC::CBitMemStream, NLMISC::CMemStream, and NLMISC::CStringStream.

Definition at line 404 of file stream.h.

References serialMultimap().

template<class K , class T , class H >
void NLMISC::IStream::serialCont ( CHashMap< K, T, H > &  cont  )  [inline]

Definition at line 402 of file stream.h.

References serialMap().

template<class K , class T >
void NLMISC::IStream::serialCont ( std::map< K, T > &  cont  )  [inline]

Reimplemented in NLMISC::CBitMemStream, NLMISC::CMemStream, and NLMISC::CStringStream.

Definition at line 400 of file stream.h.

References serialMap().

template<class T >
void NLMISC::IStream::serialCont ( std::multiset< T > &  cont  )  [inline]

Reimplemented in NLMISC::CBitMemStream, NLMISC::CMemStream, and NLMISC::CStringStream.

Definition at line 398 of file stream.h.

References serialSTLCont().

template<class T >
void NLMISC::IStream::serialCont ( std::set< T > &  cont  )  [inline]

Reimplemented in NLMISC::CBitMemStream, NLMISC::CMemStream, and NLMISC::CStringStream.

Definition at line 396 of file stream.h.

References serialSTLCont().

template<class T >
void NLMISC::IStream::serialCont ( std::deque< T > &  cont  )  [inline]

Reimplemented in NLMISC::CBitMemStream, NLMISC::CMemStream, and NLMISC::CStringStream.

Definition at line 394 of file stream.h.

References serialSTLCont().

template<class T >
void NLMISC::IStream::serialCont ( std::list< T > &  cont  )  [inline]

Reimplemented in NLMISC::CBitMemStream, NLMISC::CMemStream, and NLMISC::CStringStream.

Definition at line 392 of file stream.h.

References serialSTLCont().

template<class T , class Allocator >
void NLMISC::IStream::serialCont ( std::vector< T, Allocator > &  cont  )  [inline]

Definition at line 390 of file stream.h.

References serialVector().

Referenced by NLSOUND::CBackgroundSoundManager::load(), NLMISC::CEntityIdTranslator::load(), loadForm(), loadForm2(), NLMISC::CSheetId::loadSheetId(), NLMISC::CEntityIdTranslator::save(), NLSOUND::CComplexSound::serial(), NLSOUND::CBackgroundSoundManager::TFxZone::serial(), NLSOUND::CBackgroundSoundManager::TSoundData::serial(), NLSOUND::CBackgroundSoundManager::TBanksData::serial(), NLSOUND::CBackgroundSound::serial(), NLSOUND::CAudioMixerUser::TSampleBankHeader::serial(), NLSOUND::CUserVarSerializer::serial(), NLPACS::CRetrieverInstance::serial(), NLPACS::CRetrieverBank::serial(), NLPACS::CRetrievableSurface::TLoop::serial(), NLPACS::CRetrievableSurface::serial(), NLPACS::CPrimitiveBlock::serial(), NLPACS::CLocalRetriever::CTopology::serial(), NLPACS::CLocalRetriever::CTip::serial(), NLPACS::CLocalRetriever::serial(), NLPACS::CGlobalRetriever::serial(), NLPACS::CFaceGrid::serial(), NLPACS::CExteriorMesh::serial(), NLPACS::CEdgeQuad::serial(), NLPACS::CCollisionMeshBuild::serial(), NLPACS::CChain::serial(), NLPACS::COrderedChain::serial(), NLPACS::COrderedChain3f::serial(), NLNET::TModuleRemMsg::serial(), NLMISC::CNoiseColorGradient::serial(), NLMISC::CBitSet::serial(), NLLIGO::CZoneTemplate::serial(), NLLIGO::CZoneRegion::serial(), NLLIGO::CZoneEdge::serial(), NLLIGO::CPrimRegion::serial(), NLLIGO::CPrimZone::serial(), NLLIGO::CPrimPath::serial(), NL3D::CZone::serial(), NL3D::CVegetableShape::serial(), NL3D::CTileVegetableDesc::serial(), NL3D::CSkeletonWeight::serial(), NL3D::CInstanceGroup::serial(), NL3D::CInstanceGroup::CInstance::serial(), NL3D::CPortal::serial(), NL3D::CPointLightNamedArray::serial(), NL3D::CPatch::serial(), NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::serial(), NL3D::CMeshMRMSkinnedGeom::serial(), NL3D::CMaterial::serial(), NL3D::CLodCharacterTexture::serial(), NL3D::CLodCharacterShapeBank::serial(), NL3D::CLodCharacterShape::serial(), NL3D::CLodCharacterShape::CBoneInfluence::serial(), NL3D::CLodCharacterShape::CAnim::serial(), NL3D::CLodCharacterShapeBuild::serial(), NL3D::CIndexBuffer::serial(), NL3D::CIGSurfaceLight::serial(), NL3D::CHLSTextureBank::serial(), NL3D::CHLSColorTexture::serial(), NL3D::CHLSColorTexture::CMask::serial(), NL3D::CCluster::serial(), NL3D::CAnimationSet::serial(), NL3D::CAnimation::serial(), NL3D::CMaterialBase::serial(), NL3D::CMeshMRMSkinnedGeom::CRdrPass::serial(), NL3D::CMeshBase::CLightMapInfoList::serial(), NL3D::CMeshBase::CLightInfoMapListV7::serial(), NL3D::CMeshGeom::CMatrixBlock::serial(), NLMISC::CCommandRegistry::serialCommands(), NL3D::CVectorPacker::serialPackedVector16(), and NLNET::CTransportClass::CRegisteredPropCont< T >::serialValue().

template<class K , class T >
void NLMISC::IStream::serialContPolyPtr ( std::map< K, T > &  cont  )  [inline]

Definition at line 458 of file stream.h.

References serialMapPolyPtr().

template<class T >
void NLMISC::IStream::serialContPolyPtr ( std::multiset< T > &  cont  )  [inline]

Definition at line 456 of file stream.h.

References serialSTLContPolyPtr().

template<class T >
void NLMISC::IStream::serialContPolyPtr ( std::set< T > &  cont  )  [inline]

Definition at line 454 of file stream.h.

References serialSTLContPolyPtr().

template<class T >
void NLMISC::IStream::serialContPolyPtr ( std::deque< T > &  cont  )  [inline]

Definition at line 452 of file stream.h.

References serialSTLContPolyPtr().

template<class T >
void NLMISC::IStream::serialContPolyPtr ( std::list< T > &  cont  )  [inline]

Definition at line 450 of file stream.h.

References serialSTLContPolyPtr().

template<class T , class Allocator >
void NLMISC::IStream::serialContPolyPtr ( std::vector< T, Allocator > &  cont  )  [inline]

Definition at line 448 of file stream.h.

References serialVectorPolyPtr().

Referenced by NLLIGO::IPrimitive::serial(), and NL3D::CAnimation::serial().

template<class T >
void NLMISC::IStream::serialContPtr ( std::multiset< T > &  cont  )  [inline]

Definition at line 439 of file stream.h.

References serialSTLContPtr().

template<class T >
void NLMISC::IStream::serialContPtr ( std::set< T > &  cont  )  [inline]

Definition at line 437 of file stream.h.

References serialSTLContPtr().

template<class T >
void NLMISC::IStream::serialContPtr ( std::deque< T > &  cont  )  [inline]

Definition at line 435 of file stream.h.

References serialSTLContPtr().

template<class T >
void NLMISC::IStream::serialContPtr ( std::list< T > &  cont  )  [inline]

Definition at line 433 of file stream.h.

References serialSTLContPtr().

template<class T , class Allocator >
void NLMISC::IStream::serialContPtr ( std::vector< T, Allocator > &  cont  )  [inline]

Definition at line 431 of file stream.h.

References serialVectorPtr().

Referenced by NL3D::CAnimationSet::serial().

template<class T >
void NLMISC::IStream::serialEnum ( T em  )  [inline]
void NLMISC::IStream::serialIStreamable ( IStreamable *&  ptr  )  [private]
template<class T >
void NLMISC::IStream::serialMap ( T cont  )  [inline, private]

STL map<> Support up to sint32 length containers.

the object T must provide:

  • typedef iterator; (providing operator++() and operator*())
  • typedef value_type; (must be a std::pair<>)
  • typedef key_type; (must be the type of the key)
  • void clear();
  • size_type size() const;
  • iterator begin();
  • iterator end();
  • iterator insert(iterator it, const value_type& x);

Known Supported containers: map<>

Parameters:
cont a STL map<> container.

Definition at line 1560 of file stream.h.

References checkStreamSize(), isReading(), serial(), xmlPop(), xmlPush(), xmlPushBegin(), xmlPushEnd(), and xmlSetAttrib().

Referenced by serialCont().

template<class T >
void NLMISC::IStream::serialMapContLenPolyPtr ( T cont,
sint32  len 
) [inline, private]

Map serialisation.

PolyPtr version Support up to sint32 length containers. serialize just len element of the container.

Definition at line 1300 of file stream.h.

References checkStreamSize(), isReading(), serial(), xmlPop(), xmlPush(), and xmlPushEnd().

Referenced by serialMapPolyPtr().

template<class K , class T >
void NLMISC::IStream::serialMapPolyPtr ( std::map< K, T > &  cont  )  [inline, private]

special version for serializing a map.

PolyPtr version Support up to sint32 length containers.

Definition at line 1421 of file stream.h.

References isReading(), serial(), serialMapContLenPolyPtr(), xmlPop(), xmlPushBegin(), and xmlSetAttrib().

Referenced by serialContPolyPtr().

void NLMISC::IStream::serialMemStream ( CMemStream b  )  [virtual]
template<class T >
void NLMISC::IStream::serialMultimap ( T cont  )  [inline, private]

STL map<> and multimap<> serialisation.

Support up to sint32 length containers.

the object T must provide:

  • typedef iterator; (providing operator++() and operator*())
  • typedef value_type; (must be a std::pair<>)
  • typedef key_type; (must be the type of the key)
  • void clear();
  • size_type size() const;
  • iterator begin();
  • iterator end();
  • iterator insert(iterator it, const value_type& x);

Known Supported containers: map<>, multimap<>.

Parameters:
cont a STL map<> or multimap<> container.

Definition at line 1468 of file stream.h.

References checkStreamSize(), isReading(), serial(), xmlPop(), xmlPush(), xmlPushBegin(), xmlPushEnd(), and xmlSetAttrib().

Referenced by serialCont().

template<class T >
void NLMISC::IStream::serialPolyPtr ( T *&  ptr  )  [inline]

Serialize Polymorphic Objet Ptr.

Works with NULL pointers. If the same object is found mutliple time in the stream, ONLY ONE instance is written! NB: The ptr is serialised as a uint64 (64 bit compliant).

Parameters:
ptr a pointer on a IStreamable object.
See also:
resetPtrTable()

Definition at line 571 of file stream.h.

References serialIStreamable().

Referenced by NL3D::CAnimationOptimizer::cloneTrack(), NLLIGO::CPrimitives::serial(), NLLIGO::IPrimitive::serial(), NL3D::CMaterialBase::CAnimatedTexture::serial(), and serialSTLContLenPolyPtr().

template<class T >
void NLMISC::IStream::serialPtr ( T *&  ptr  )  [inline]

Serialize Non Polymorphic Objet Ptr.

Works with NULL pointers. If the same object is found mutliple time in the stream, ONLY ONE instance is written! NB: The ptr is serialised as a uint64 (64 bit compliant).

Parameters:
ptr a pointer on a base type or an object.
See also:
resetPtrTable()

Definition at line 469 of file stream.h.

References _IdMap, _NextSerialPtrId, isReading(), serial(), xmlPop(), xmlPushBegin(), xmlPushEnd(), and xmlSetAttrib().

Referenced by NL3D::CParticleSystemShape::buildFromPS(), NL3D::CParticleSystemShape::flushTextures(), NL3D::CParticleSystemShape::instanciatePS(), and serialSTLContLenPtr().

template<class K , class T >
void NLMISC::IStream::serialPtrCont ( std::map< K, T > &  cont  )  [inline]

Definition at line 413 of file stream.h.

References serialPtrMap().

Referenced by loadForm2().

template<class T >
void NLMISC::IStream::serialPtrMap ( T cont  )  [inline, private]

STL map<> Support up to sint32 length containers.

Container must contain NeL smart pointers.

the object T must provide:

  • typedef iterator; (providing operator++() and operator*())
  • typedef value_type; (must be a std::pair<>)
  • typedef key_type; (must be the type of the key)
  • void clear();
  • size_type size() const;
  • iterator begin();
  • iterator end();
  • iterator insert(iterator it, const value_type& x);

Known Supported containers: map<>

Parameters:
cont a STL map<> container.

Definition at line 1638 of file stream.h.

References checkStreamSize(), isReading(), serial(), xmlPop(), xmlPush(), xmlPushBegin(), xmlPushEnd(), and xmlSetAttrib().

Referenced by serialPtrCont().

template<class T >
void NLMISC::IStream::serialShortEnum ( T em  )  [inline]

Template short enum serialisation. Serialized as a uint8 (with checking).

Definition at line 326 of file stream.h.

References isReading(), nlassert, and serial().

Referenced by NLNET::CStandardGateway::sendPendingModuleUpdate().

template<class T >
void NLMISC::IStream::serialSTLCont ( T cont  )  [inline, private]

standard STL containers serialisation.

Don't work with map<> and multimap<>. Support up to sint32 length containers.

the object T must provide:

  • typedef iterator; (providing operator++() and operator*())
  • typedef value_type; (a base type (uint...), or an object providing "void serial(IStream&)" method.)
  • void clear();
  • size_type size() const;
  • iterator begin();
  • iterator end();
  • iterator insert(iterator it, const value_type& x);

Known Supported containers: vector<>, list<>, deque<>, set<>, multiset<>.

Parameters:
cont a STL container (vector<>, set<> ...).

Definition at line 1051 of file stream.h.

References isReading(), serial(), serialSTLContLen(), xmlPop(), xmlPushBegin(), xmlPushEnd(), and xmlSetAttrib().

Referenced by serialCont().

template<class T >
void NLMISC::IStream::serialSTLContLen ( T cont,
sint32  len 
) [inline, private]

standard STL containers serialization.

Don't work with map<> and multimap<>. Support up to sint32 length containers. serialize just len element of the container.

Definition at line 998 of file stream.h.

References checkStreamSize(), isReading(), serial(), void(), xmlPop(), and xmlPush().

Referenced by serialSTLCont().

template<class T >
void NLMISC::IStream::serialSTLContLenPolyPtr ( T cont,
sint32  len 
) [inline, private]

standard STL containers serialisation.

Don't work with map<> and multimap<>. PolyPtr version Support up to sint32 length containers. serialize just len element of the container.

Definition at line 1268 of file stream.h.

References checkStreamSize(), isReading(), and serialPolyPtr().

Referenced by serialSTLContPolyPtr(), and serialVectorPolyPtr().

template<class T >
void NLMISC::IStream::serialSTLContLenPtr ( T cont,
sint32  len 
) [inline, private]

standard STL containers serialisation.

Don't work with map<> and multimap<>. Ptr version. Support up to sint32 length containers. serialize just len element of the container.

Definition at line 1155 of file stream.h.

References checkStreamSize(), isReading(), and serialPtr().

Referenced by serialSTLContPtr(), and serialVectorPtr().

template<class T >
void NLMISC::IStream::serialSTLContPolyPtr ( T cont  )  [inline, private]

standard STL containers serialisation.

Don't work with map<> and multimap<>. PolyPtr version Support up to sint32 length containers.

Definition at line 1355 of file stream.h.

References isReading(), serial(), and serialSTLContLenPolyPtr().

Referenced by serialContPolyPtr().

template<class T >
void NLMISC::IStream::serialSTLContPtr ( T cont  )  [inline, private]

standard STL containers serialisation.

Don't work with map<> and multimap<>. Ptr version. Support up to sint32 length containers.

Definition at line 1188 of file stream.h.

References isReading(), serial(), serialSTLContLenPtr(), xmlPop(), xmlPushBegin(), xmlPushEnd(), and xmlSetAttrib().

Referenced by serialContPtr().

template<class T >
void NLMISC::IStream::serialVector ( T cont  )  [inline, protected]

special version for serializing a vector.

Support up to sint32 length containers.

Definition at line 1088 of file stream.h.

References checkStreamSize(), NLMISC::contReset(), isReading(), serial(), xmlPop(), xmlPush(), xmlPushBegin(), xmlPushEnd(), and xmlSetAttrib().

Referenced by NLMISC::CStringStream::serialCont(), serialCont(), and NLMISC::CBitMemStream::serialCont().

template<class T >
void NLMISC::IStream::serialVectorPolyPtr ( T cont  )  [inline, private]

special version for serializing a vector.

PolyPtr version Support up to sint32 length containers.

Definition at line 1378 of file stream.h.

References checkStreamSize(), NLMISC::contReset(), isReading(), serial(), serialSTLContLenPolyPtr(), xmlPop(), xmlPushBegin(), xmlPushEnd(), and xmlSetAttrib().

Referenced by serialContPolyPtr().

template<class T >
void NLMISC::IStream::serialVectorPtr ( T cont  )  [inline, private]

special version for serializing a vector.

Ptr version. Support up to sint32 length containers.

Definition at line 1223 of file stream.h.

References checkStreamSize(), NLMISC::contReset(), isReading(), serial(), serialSTLContLenPtr(), xmlPop(), xmlPushBegin(), xmlPushEnd(), and xmlSetAttrib().

Referenced by serialContPtr().

uint NLMISC::IStream::serialVersion ( uint  currentVersion  ) 

Serialize a version number.

Each object should store/read first a version number, using this method. Then he can use the streamVersion returned to see how he should serialise himself.

NB: Version Number is read/store as a uint8, or uint32 if too bigger..

Parameters:
currentVersion the current version of the class, provided by user.
Returns:
the version of the stream. If the stream is an Output stream, currentVersion is returned.
See also:
setVersionException() getVersionException()

Definition at line 283 of file stream.cpp.

References _ThrowOnNewer, _ThrowOnOlder, isReading(), serial(), xmlPop(), and xmlPush().

Referenced by NLMISC::CEntityIdTranslator::load(), loadForm(), loadForm2(), NLMISC::CEntityIdTranslator::save(), NLSOUND::CMusicSound::serial(), NLPACS::CSurfaceQuadTree::serial(), NLPACS::CRetrieverInstance::serial(), NLPACS::CRetrieverBank::serial(), NLPACS::CRetrievableSurface::serial(), NLPACS::CPrimitiveBlock::serial(), NLPACS::CPrimitiveDesc::serial(), NLPACS::CLocalRetriever::serial(), NLPACS::CGlobalRetriever::serial(), NLPACS::CFaceGrid::serial(), NLPACS::CExteriorMesh::serial(), NLPACS::CEdgeQuad::serial(), NLPACS::CChainQuad::serial(), NLPACS::CChain::serial(), NLPACS::COrderedChain::serial(), NLPACS::COrderedChain3f::serial(), NLMISC::CNoiseColorGradient::serial(), NLMISC::CNoiseValue::serial(), NLMISC::CMatrix::serial(), NLMISC::CBitSet::serial(), NLMISC::CAABBox::serial(), NLLIGO::CZoneRegion::serial(), NLLIGO::CZoneRegion::SZoneUnit2::serial(), NLLIGO::CZoneEdge::serial(), NLLIGO::CTransition::serial(), NLLIGO::CPrimitives::serial(), NLLIGO::CPrimRegion::serial(), NLLIGO::CMaterial::serial(), NL3D::CZone::serial(), NL3D::CPatchInfo::CBindInfo::serial(), NL3D::CZone::CPatchConnect::serial(), NL3D::CBorderVertex::serial(), NL3D::CVertexBuffer::serial(), NL3D::CVegetableShape::serial(), NL3D::CVegetable::serial(), NL3D::CTrackSampledVector::serial(), NL3D::CTrackSampledQuat::serial(), NL3D::CTrackSampledCommon::CTimeBlock::serial(), NL3D::CTileVegetableDesc::serial(), NL3D::CTileNoiseMap::serial(), NL3D::CTileNoise::serial(), NL3D::CSurfaceLightGrid::serial(), NL3D::CSkeletonWeight::CNode::serial(), NL3D::CSkeletonWeight::serial(), NL3D::CInstanceGroup::serial(), NL3D::CInstanceGroup::CInstance::serial(), NL3D::CPortal::serial(), NL3D::CPointLightNamedArray::serial(), NL3D::CPointLightNamed::serial(), NL3D::CPointLight::serial(), NL3D::CPatch::serial(), NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::serial(), NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::serial(), NL3D::CMeshMRMSkinned::serial(), NL3D::CMeshMRMSkinnedGeom::serial(), NL3D::CMaterial::serial(), NL3D::CLodCharacterTexture::serial(), NL3D::CLodCharacterShapeBank::serial(), NL3D::CLodCharacterShape::serial(), NL3D::CLodCharacterShape::CBoneInfluence::serial(), NL3D::CLodCharacterShape::CAnim::serial(), NL3D::CLodCharacterShapeBuild::serial(), NL3D::CIndexBuffer::serial(), NL3D::CIGSurfaceLight::serial(), NL3D::CHLSTextureBank::CTextureInstance::serial(), NL3D::CHLSTextureBank::serial(), NL3D::CHLSColorTexture::serial(), NL3D::CHLSColorTexture::CMask::serial(), NL3D::CHLSColorDelta::serial(), NL3D::CCluster::serial(), NL3D::CCameraInfo::serial(), NL3D::CBoneBase::serial(), NL3D::CAnimationSet::serial(), NL3D::CAnimationPlaylist::serial(), NL3D::CAnimation::serial(), NL3D::CMaterialBase::serial(), NL3D::CSurfaceLightGrid::CCellCorner::serial(), NL3D::CShadowVertex::serial(), NL3D::CPSAttrib< T >::serial(), NL3D::CPointLightNamedArray::CPointLightGroup::serial(), NL3D::CMeshMRMSkinnedGeom::CRdrPass::serial(), NL3D::CMeshMRMGeom::CLodInfo::serial(), NL3D::CMeshMRMGeom::CRdrPass::serial(), NL3D::CMeshBase::CLightMapInfoList::serial(), NL3D::CMeshBase::CLightMapInfoList::CMatStage::serial(), NL3D::CMeshGeom::CMatrixBlock::serial(), NL3D::CMeshGeom::CRdrPass::serial(), NL3D::CIGSurfaceLight::CRetrieverLightGrid::serial(), NL3D::CMaterialBase::CTexAnimTracks::serial(), NL3D::CMaterial::CLightMap::serial2(), NL3D::CTrackSampledCommon::serialCommon(), NL3D::CVertexBuffer::serialHeader(), NL3D::CMeshMRMGeom::serialLodVertexData(), and NL3D::CVertexBuffer::serialSubset().

void NLMISC::IStream::setInOut ( bool  inputStream  )  [protected]

Change, in live, the state of the inputStream.

This could be useful in certain case. The deriver which would want to do such a thing must call this method, and implement his own behavior. In certain case, it should call resetPtrTable() if he want to reset the stream ptr info (maybe always)...

Definition at line 444 of file stream.cpp.

References _InputStream.

Referenced by NLMISC::CBitMemStream::getSerialItem(), and NLMISC::CMemStream::invert().

void NLMISC::IStream::setVersionException ( bool  throwOnOlder,
bool  throwOnNewer 
) [static]

Set the behavior of IStream regarding input stream that are older/newer than the class.

If throwOnOlder==true, IStream throws a EOlderStream when needed. If throwOnNewer==true, IStream throws a ENewerStream when needed.

By default, the behavior is throwOnOlder=false, throwOnNewer=true.

See also:
serialVersion() getVersionException()

Definition at line 78 of file stream.cpp.

References _ThrowOnNewer, and _ThrowOnOlder.

void NLMISC::IStream::setXMLMode ( bool  on  )  [protected]

Set the XML mode.

Parameters:
on is true to enable XML mode else false

Definition at line 458 of file stream.cpp.

References _XML.

Referenced by NLMISC::COXml::COXml(), NLMISC::COXml::init(), and NLMISC::CIXml::init().

void NLMISC::IStream::swap ( IStream other  ) 

exchange

Reimplemented in NLMISC::CBitMemStream, NLMISC::CMemStream, and NLNET::CMessage.

Definition at line 115 of file stream.cpp.

References _IdMap, _InputStream, _NextSerialPtrId, and _XML.

template<class T >
static T& NLMISC::IStream::unconst ( const T t  )  [inline, static]

Definition at line 254 of file stream.h.

Referenced by NLNET::CMessage::lockSubMessage().

bool NLMISC::IStream::xmlBreakLine (  )  [inline]

xmlBreakLine() insert a break line in the XML stream.

Returns:
true if the break line is added, return false if no node is opened.

Definition at line 873 of file stream.h.

References _XML, and xmlBreakLineInternal().

virtual bool NLMISC::IStream::xmlBreakLineInternal (  )  [inline, protected, virtual]

xmlBreakLine implementation

Reimplemented in NLMISC::CIXml, and NLMISC::COXml.

Definition at line 924 of file stream.h.

Referenced by xmlBreakLine().

bool NLMISC::IStream::xmlComment ( const char *  comment  )  [inline]

xmlComment() insert a comment line in the XML stream.

Returns:
true if the comment is added, return false if no node is opened.

Definition at line 890 of file stream.h.

References _XML, and xmlCommentInternal().

virtual bool NLMISC::IStream::xmlCommentInternal ( const char *   )  [inline, protected, virtual]

xmlComment implementation

Reimplemented in NLMISC::CIXml, and NLMISC::COXml.

Definition at line 927 of file stream.h.

Referenced by xmlComment().

bool NLMISC::IStream::xmlPop (  )  [inline]
virtual bool NLMISC::IStream::xmlPopInternal (  )  [inline, protected, virtual]

xmlPop implementation

Reimplemented in NLMISC::CIXml, and NLMISC::COXml.

Definition at line 918 of file stream.h.

Referenced by xmlPop().

bool NLMISC::IStream::xmlPush ( const char *  name  )  [inline]
bool NLMISC::IStream::xmlPushBegin ( const char *  name  )  [inline]
virtual bool NLMISC::IStream::xmlPushBeginInternal ( const char *   )  [inline, protected, virtual]

xmlPushBegin implementation

Reimplemented in NLMISC::CIXml, and NLMISC::COXml.

Definition at line 912 of file stream.h.

Referenced by xmlPush(), and xmlPushBegin().

bool NLMISC::IStream::xmlPushEnd (  )  [inline]

xmlPushEnd() close the node header.

Returns:
true if you can close the node header, false if no node header have been opened with xmlPushBegin().

Definition at line 821 of file stream.h.

References _XML, and xmlPushEndInternal().

Referenced by NLLIGO::CPrimRegion::serial(), NLMISC::CObjectVector< sint8, false >::serial(), serialIStreamable(), serialMap(), serialMapContLenPolyPtr(), serialMultimap(), serialPtr(), serialPtrMap(), serialSTLCont(), serialSTLContPtr(), serialVector(), serialVectorPolyPtr(), and serialVectorPtr().

virtual bool NLMISC::IStream::xmlPushEndInternal (  )  [inline, protected, virtual]

xmlPushEnd implementation

Reimplemented in NLMISC::CIXml, and NLMISC::COXml.

Definition at line 915 of file stream.h.

Referenced by xmlPush(), and xmlPushEnd().

template<class T >
void NLMISC::IStream::xmlSerial ( T value0,
T value1,
T value2,
T value3,
const char *  nodeName 
) [inline]

Definition at line 762 of file stream.h.

References serial(), xmlPop(), and xmlPush().

template<class T >
void NLMISC::IStream::xmlSerial ( T value0,
T value1,
T value2,
const char *  nodeName 
) [inline]

Definition at line 750 of file stream.h.

References serial(), xmlPop(), and xmlPush().

template<class T >
void NLMISC::IStream::xmlSerial ( T value0,
T value1,
const char *  nodeName 
) [inline]

Definition at line 738 of file stream.h.

References serial(), xmlPop(), and xmlPush().

template<class T >
void NLMISC::IStream::xmlSerial ( T value0,
const char *  nodeName 
) [inline]
bool NLMISC::IStream::xmlSetAttrib ( const char *  name  )  [inline]

xmlSetAttrib() set the name of the next node header attribute serialised.

Parameters:
name is the name of the node header attribute serialised.
Returns:
true if the attribute name have been set, false if the node header is not open (the call is not between xmlPushBegin and xmlPushEnd)

Definition at line 856 of file stream.h.

References _XML, and xmlSetAttribInternal().

Referenced by NLLIGO::CPrimRegion::serial(), NLMISC::CObjectVector< sint8, false >::serial(), serialIStreamable(), serialMap(), serialMapPolyPtr(), serialMultimap(), serialPtr(), serialPtrMap(), serialSTLCont(), serialSTLContPtr(), serialVector(), serialVectorPolyPtr(), and serialVectorPtr().

virtual bool NLMISC::IStream::xmlSetAttribInternal ( const char *   )  [inline, protected, virtual]

xmlBreakLine implementation

Reimplemented in NLMISC::CIXml, and NLMISC::COXml.

Definition at line 921 of file stream.h.

Referenced by xmlSetAttrib().


Member Data Documentation

CHashMap<uint64, void*> NLMISC::IStream::_IdMap [private]

Definition at line 983 of file stream.h.

Referenced by resetPtrTable(), serialIStreamable(), serialPtr(), and swap().

Definition at line 977 of file stream.h.

Referenced by isReading(), IStream(), operator=(), setInOut(), and swap().

Definition at line 982 of file stream.h.

Referenced by resetPtrTable(), serialIStreamable(), serialPtr(), and swap().

Definition at line 979 of file stream.h.

Referenced by getVersionException(), serialVersion(), and setVersionException().

bool NLMISC::IStream::_ThrowOnOlder = false [static, private]

Definition at line 978 of file stream.h.

Referenced by getVersionException(), serialVersion(), and setVersionException().


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

Generated on Thu Jan 7 08:30:19 2010 for NeL by  doxygen 1.6.1