Ice 3.7 C++11 API Reference
Classes | Public Types | Public Member Functions | List of all members
Ice::InputStream Class Reference

Interface for input streams used to extract Slice types from a sequence of bytes. More...

#include <Ice/Ice.h>

Inheritance diagram for Ice::InputStream:
Inheritance graph
[legend]
Collaboration diagram for Ice::InputStream:
Collaboration graph
[legend]

Public Types

typedef void(* PatchFunc) (void *addr, const ValuePtr &v)
 Signature for a patch function, used to receive an unmarshaled value. More...
 
typedef size_t size_type
 

Public Member Functions

void clear ()
 Releases any data retained by encapsulations. More...
 
void endEncapsulation ()
 Ends the current encapsulation. More...
 
SlicedDataPtr endException (bool preserve)
 Marks the end of a user exception. More...
 
void endSlice ()
 Indicates that the end of a value or exception slice has been reached. More...
 
SlicedDataPtr endValue (bool preserve)
 Marks the end of a class instance. More...
 
void * getClosure () const
 Obtains the closure data associated with this stream. More...
 
Int getEncapsulationSize ()
 Determines the size of the current encapsulation, excluding the encapsulation header. More...
 
const EncodingVersiongetEncoding () const
 Determines the current encoding version. More...
 
void initialize (const CommunicatorPtr &communicator)
 Initializes the stream to use the communicator's default encoding version. More...
 
void initialize (const CommunicatorPtr &communicator, const EncodingVersion &version)
 Initializes the stream to use the given communicator and encoding version. More...
 
 InputStream ()
 Constructs a stream using the latest encoding version but without a communicator. More...
 
 InputStream (const CommunicatorPtr &communicator)
 Constructs a stream using the communicator's default encoding version. More...
 
 InputStream (const CommunicatorPtr &communicator, const EncodingVersion &version)
 Constructs a stream using the given communicator and encoding version. More...
 
 InputStream (const CommunicatorPtr &communicator, const EncodingVersion &version, const std::pair< const Byte *, const Byte * > &bytes)
 Constructs a stream using the given communicator and encoding version. More...
 
 InputStream (const CommunicatorPtr &communicator, const EncodingVersion &version, const std::vector< Byte > &bytes)
 Constructs a stream using the given communicator and encoding version. More...
 
 InputStream (const CommunicatorPtr &communicator, const std::pair< const Byte *, const Byte * > &bytes)
 Constructs a stream using the communicator's default encoding version. More...
 
 InputStream (const CommunicatorPtr &communicator, const std::vector< Byte > &bytes)
 Constructs a stream using the communicator's default encoding version. More...
 
 InputStream (const EncodingVersion &version)
 Constructs a stream using the given encoding version but without a communicator. More...
 
 InputStream (const EncodingVersion &version, const std::pair< const Byte *, const Byte * > &bytes)
 Constructs a stream using the given encoding version but without a communicator. More...
 
 InputStream (const EncodingVersion &version, const std::vector< Byte > &bytes)
 Constructs a stream using the given encoding version but without a communicator. More...
 
 InputStream (const std::pair< const Byte *, const Byte * > &bytes)
 Constructs a stream using the latest encoding version but without a communicator. More...
 
 InputStream (const std::vector< Byte > &bytes)
 Constructs a stream using the latest encoding version but without a communicator. More...
 
size_type pos ()
 Obtains the current position of the stream. More...
 
void pos (size_type p)
 Sets a new position for the stream. More...
 
template<typename T , typename ::std::enable_if<::std::is_base_of< ObjectPrx, T >::value >::type * = nullptr>
void read (::std::shared_ptr< T > &v)
 Reads a typed proxy from the stream. More...
 
template<typename T , typename ::std::enable_if<::std::is_base_of< Value, T >::value >::type * = nullptr>
void read (::std::shared_ptr< T > &v)
 Reads a value (instance of a Slice class) from the stream. More...
 
void read (bool &v)
 Reads a bool from the stream. More...
 
void read (Byte &v)
 Reads a byte from the stream. More...
 
void read (const char *&vdata, size_t &vsize, bool convert=true)
 Reads a string from the stream. More...
 
void read (Double &v)
 Reads a double from the stream. More...
 
void read (Float &v)
 Reads a float from the stream. More...
 
void read (Int &v)
 Reads an int from the stream. More...
 
template<typename T >
void read (Int tag, IceUtil::Optional< T > &v)
 Reads an optional data value from the stream. More...
 
void read (Long &v)
 Reads a long from the stream. More...
 
void read (PatchFunc patchFunc, void *patchAddr)
 Reads a value (instance of a Slice class) from the stream. More...
 
void read (Short &v)
 Reads a short from the stream. More...
 
void read (std::pair< const bool *, const bool * > &v)
 Reads a sequence of boolean values from the stream. More...
 
void read (std::pair< const Byte *, const Byte * > &v)
 Reads a sequence of bytes from the stream. More...
 
void read (std::pair< const double *, const double * > &v)
 Reads a sequence of doubles from the stream. More...
 
void read (std::pair< const float *, const float * > &v)
 Reads a sequence of floats from the stream. More...
 
void read (std::pair< const int *, const int * > &v)
 Reads a sequence of ints from the stream. More...
 
void read (std::pair< const long long *, const long long * > &v)
 Reads a sequence of longs from the stream. More...
 
void read (std::pair< const short *, const short * > &v)
 Reads a sequence of boolean values from the stream. More...
 
template<typename T >
void read (std::pair< const T *, const T * > &v)
 Extracts a sequence of data values from the stream. More...
 
void read (std::string &v, bool convert=true)
 Reads a string from the stream. More...
 
void read (std::vector< bool > &v)
 Reads a sequence of boolean values from the stream. More...
 
void read (std::vector< Byte > &v)
 Reads a sequence of bytes from the stream. More...
 
void read (std::vector< Double > &v)
 Reads a sequence of doubles from the stream. More...
 
void read (std::vector< Float > &v)
 Reads a sequence of floats from the stream. More...
 
void read (std::vector< Int > &v)
 Reads a sequence of ints from the stream. More...
 
void read (std::vector< Long > &v)
 Reads a sequence of longs from the stream. More...
 
void read (std::vector< Short > &v)
 Reads a sequence of shorts from the stream. More...
 
void read (std::vector< std::string > &v, bool convert=true)
 Reads a sequence of strings from the stream. More...
 
void read (std::vector< std::wstring > &v)
 Reads a sequence of wide strings from the stream. More...
 
void read (std::wstring &v)
 Reads a wide string from the stream. More...
 
template<typename T >
void read (T &v)
 Reads a data value from the stream. More...
 
template<typename T >
void readAll (std::initializer_list< int > tags, IceUtil::Optional< T > &v)
 Reads a list of optional data values. More...
 
template<typename T , typename... Te>
void readAll (std::initializer_list< int > tags, IceUtil::Optional< T > &v, IceUtil::Optional< Te > &... ve)
 Reads a list of optional data values. More...
 
template<typename T >
void readAll (T &v)
 Reads a list of mandatory data values. More...
 
template<typename T , typename... Te>
void readAll (T &v, Te &... ve)
 Reads a list of mandatory data values. More...
 
Int readAndCheckSeqSize (int minSize)
 Reads and validates a sequence size. More...
 
void readBlob (const Byte *&v, Container::size_type sz)
 Reads a blob of bytes from the stream. More...
 
void readBlob (std::vector< Byte > &bytes, Int sz)
 Reads a blob of bytes from the stream. More...
 
EncodingVersion readEncapsulation (const Byte *&v, Int &sz)
 Returns a blob of bytes representing an encapsulation. More...
 
Int readEnum (Int maxValue)
 Reads an enumerator from the stream. More...
 
bool readOptional (Int tag, OptionalFormat expectedFormat)
 Determine if an optional value is available for reading. More...
 
void readPendingValues ()
 Indicates that unmarshaling is complete, except for any class instances. More...
 
std::shared_ptr< ObjectPrxreadProxy ()
 Reads a proxy from the stream. More...
 
Int readSize ()
 Extracts a size from the stream. More...
 
void resize (Container::size_type sz)
 Resizes the stream to a new size. More...
 
void setClassGraphDepthMax (size_t n)
 Sets an upper limit on the depth of a class graph. More...
 
void * setClosure (void *p)
 Associates closure data with this stream. More...
 
void setCompactIdResolver (std::function< std::string(int)> r)
 Sets the compact ID resolver to use when unmarshaling value and exception instances. More...
 
void setLogger (const LoggerPtr &logger)
 Sets the logger to use when logging trace messages. More...
 
void setSliceValues (bool b)
 Indicates whether to slice instances of Slice classes to a known Slice type when a more derived type is unknown. More...
 
void setTraceSlicing (bool b)
 Indicates whether to log messages when instances of Slice classes are sliced. More...
 
void setValueFactoryManager (const ValueFactoryManagerPtr &vfm)
 Sets the value factory manager to use when unmarshaling value instances. More...
 
void skip (size_type size)
 Advances the current stream position by the given number of bytes. More...
 
EncodingVersion skipEmptyEncapsulation ()
 Skips an empty encapsulation. More...
 
EncodingVersion skipEncapsulation ()
 Skips over an encapsulation. More...
 
void skipOptional (OptionalFormat format)
 Skips one optional value with the given format. More...
 
void skipOptionals ()
 Skips all remaining optional values. More...
 
void skipSize ()
 Reads a size at the current position and skips that number of bytes. More...
 
void skipSlice ()
 Skips over a value or exception slice. More...
 
const EncodingVersionstartEncapsulation ()
 Reads the start of an encapsulation. More...
 
void startException ()
 Marks the start of a user exception. More...
 
std::string startSlice ()
 Reads the start of a value or exception slice. More...
 
void startValue ()
 Marks the start of a class instance. More...
 
void swap (InputStream &other)
 Swaps the contents of one stream with another. More...
 
void throwException (UserExceptionFactory factory=nullptr)
 Extracts a user exception from the stream and throws it. More...
 
 ~InputStream ()
 

Detailed Description

Interface for input streams used to extract Slice types from a sequence of bytes.

Member Typedef Documentation

◆ PatchFunc

typedef void(* Ice::InputStream::PatchFunc) (void *addr, const ValuePtr &v)

Signature for a patch function, used to receive an unmarshaled value.

Parameters
addrThe target address.
vThe unmarshaled value.

◆ size_type

Constructor & Destructor Documentation

◆ InputStream() [1/12]

Ice::InputStream::InputStream ( )

Constructs a stream using the latest encoding version but without a communicator.

This stream will not be able to unmarshal a proxy. For other unmarshaling tasks, you can provide Helpers for objects that are normally provided by a communicator. You can supply a communicator later by calling initialize().

◆ InputStream() [2/12]

Ice::InputStream::InputStream ( const std::vector< Byte > &  bytes)

Constructs a stream using the latest encoding version but without a communicator.

This stream will not be able to unmarshal a proxy. For other unmarshaling tasks, you can provide Helpers for objects that are normally provided by a communicator. You can supply a communicator later by calling initialize().

Parameters
bytesThe encoded data.

◆ InputStream() [3/12]

Ice::InputStream::InputStream ( const std::pair< const Byte *, const Byte * > &  bytes)

Constructs a stream using the latest encoding version but without a communicator.

This stream will not be able to unmarshal a proxy. For other unmarshaling tasks, you can provide Helpers for objects that are normally provided by a communicator. You can supply a communicator later by calling initialize().

Parameters
bytesThe encoded data.

◆ InputStream() [4/12]

Ice::InputStream::InputStream ( const CommunicatorPtr &  communicator)

Constructs a stream using the communicator's default encoding version.

Parameters
communicatorThe communicator to use for unmarshaling tasks.

◆ InputStream() [5/12]

Ice::InputStream::InputStream ( const CommunicatorPtr &  communicator,
const std::vector< Byte > &  bytes 
)

Constructs a stream using the communicator's default encoding version.

Parameters
communicatorThe communicator to use for unmarshaling tasks.
bytesThe encoded data.

◆ InputStream() [6/12]

Ice::InputStream::InputStream ( const CommunicatorPtr &  communicator,
const std::pair< const Byte *, const Byte * > &  bytes 
)

Constructs a stream using the communicator's default encoding version.

Parameters
communicatorThe communicator to use for unmarshaling tasks.
bytesThe encoded data.

◆ InputStream() [7/12]

Ice::InputStream::InputStream ( const EncodingVersion version)

Constructs a stream using the given encoding version but without a communicator.

This stream will not be able to unmarshal a proxy. For other unmarshaling tasks, you can provide Helpers for objects that are normally provided by a communicator. You can supply a communicator later by calling initialize().

Parameters
versionThe encoding version used to encode the data to be unmarshaled.

◆ InputStream() [8/12]

Ice::InputStream::InputStream ( const EncodingVersion version,
const std::vector< Byte > &  bytes 
)

Constructs a stream using the given encoding version but without a communicator.

This stream will not be able to unmarshal a proxy. For other unmarshaling tasks, you can provide Helpers for objects that are normally provided by a communicator. You can supply a communicator later by calling initialize().

Parameters
versionThe encoding version used to encode the data to be unmarshaled.
bytesThe encoded data.

◆ InputStream() [9/12]

Ice::InputStream::InputStream ( const EncodingVersion version,
const std::pair< const Byte *, const Byte * > &  bytes 
)

Constructs a stream using the given encoding version but without a communicator.

This stream will not be able to unmarshal a proxy. For other unmarshaling tasks, you can provide Helpers for objects that are normally provided by a communicator. You can supply a communicator later by calling initialize().

Parameters
versionThe encoding version used to encode the data to be unmarshaled.
bytesThe encoded data.

◆ InputStream() [10/12]

Ice::InputStream::InputStream ( const CommunicatorPtr &  communicator,
const EncodingVersion version 
)

Constructs a stream using the given communicator and encoding version.

Parameters
communicatorThe communicator to use for unmarshaling tasks.
versionThe encoding version used to encode the data to be unmarshaled.

◆ InputStream() [11/12]

Ice::InputStream::InputStream ( const CommunicatorPtr &  communicator,
const EncodingVersion version,
const std::vector< Byte > &  bytes 
)

Constructs a stream using the given communicator and encoding version.

Parameters
communicatorThe communicator to use for unmarshaling tasks.
versionThe encoding version used to encode the data to be unmarshaled.
bytesThe encoded data.

◆ InputStream() [12/12]

Ice::InputStream::InputStream ( const CommunicatorPtr &  communicator,
const EncodingVersion version,
const std::pair< const Byte *, const Byte * > &  bytes 
)

Constructs a stream using the given communicator and encoding version.

Parameters
communicatorThe communicator to use for unmarshaling tasks.
versionThe encoding version used to encode the data to be unmarshaled.
bytesThe encoded data.

◆ ~InputStream()

Ice::InputStream::~InputStream ( )
inline

Member Function Documentation

◆ clear()

void Ice::InputStream::clear ( )

Releases any data retained by encapsulations.

◆ endEncapsulation()

void Ice::InputStream::endEncapsulation ( )
inline

Ends the current encapsulation.

◆ endException()

SlicedDataPtr Ice::InputStream::endException ( bool  preserve)
inline

Marks the end of a user exception.

Parameters
preservePass true and the stream will preserve the unknown slices of the exception, or false to discard the unknown slices.
Returns
An object that encapsulates the unknown slice data.

◆ endSlice()

void Ice::InputStream::endSlice ( )
inline

Indicates that the end of a value or exception slice has been reached.

◆ endValue()

SlicedDataPtr Ice::InputStream::endValue ( bool  preserve)
inline

Marks the end of a class instance.

Parameters
preservePass true and the stream will preserve the unknown slices of the instance, or false to discard the unknown slices.
Returns
An object that encapsulates the unknown slice data.

◆ getClosure()

void* Ice::InputStream::getClosure ( ) const

Obtains the closure data associated with this stream.

Returns
The data as a void pointer.

◆ getEncapsulationSize()

Int Ice::InputStream::getEncapsulationSize ( )

Determines the size of the current encapsulation, excluding the encapsulation header.

Returns
The size of the encapsulated data.

◆ getEncoding()

const EncodingVersion& Ice::InputStream::getEncoding ( ) const
inline

Determines the current encoding version.

Returns
The encoding version.

◆ initialize() [1/2]

void Ice::InputStream::initialize ( const CommunicatorPtr &  communicator)

Initializes the stream to use the communicator's default encoding version.

Use initialize() if you originally constructed the stream without a communicator.

Parameters
communicatorThe communicator to use for unmarshaling tasks.

◆ initialize() [2/2]

void Ice::InputStream::initialize ( const CommunicatorPtr &  communicator,
const EncodingVersion version 
)

Initializes the stream to use the given communicator and encoding version.

Use initialize() if you originally constructed the stream without a communicator.

Parameters
communicatorThe communicator to use for unmarshaling tasks.
versionThe encoding version used to encode the data to be unmarshaled.

◆ pos() [1/2]

size_type Ice::InputStream::pos ( )
inline

Obtains the current position of the stream.

Returns
The current position.

◆ pos() [2/2]

void Ice::InputStream::pos ( size_type  p)
inline

Sets a new position for the stream.

Parameters
pThe new position.

◆ read() [1/32]

template<typename T , typename ::std::enable_if<::std::is_base_of< ObjectPrx, T >::value >::type * = nullptr>
void Ice::InputStream::read ( ::std::shared_ptr< T > &  v)
inline

Reads a typed proxy from the stream.

Parameters
vThe proxy as a user-defined type.

◆ read() [2/32]

template<typename T , typename ::std::enable_if<::std::is_base_of< Value, T >::value >::type * = nullptr>
void Ice::InputStream::read ( ::std::shared_ptr< T > &  v)
inline

Reads a value (instance of a Slice class) from the stream.

Parameters
vThe instance.

◆ read() [3/32]

void Ice::InputStream::read ( bool &  v)
inline

Reads a bool from the stream.

Parameters
vThe extracted bool.

◆ read() [4/32]

void Ice::InputStream::read ( Byte v)
inline

Reads a byte from the stream.

Parameters
vThe extracted byte.

◆ read() [5/32]

void Ice::InputStream::read ( const char *&  vdata,
size_t &  vsize,
bool  convert = true 
)

Reads a string from the stream.

Parameters
vdataA pointer to the beginning of the string.
vsizeThe number of bytes in the string.
convertDetermines whether the string is processed by the string converter, if one is installed. The default behavior is to convert strings.

◆ read() [6/32]

void Ice::InputStream::read ( Double v)

Reads a double from the stream.

Parameters
vThe extracted double.

◆ read() [7/32]

void Ice::InputStream::read ( Float v)

Reads a float from the stream.

Parameters
vThe extracted float.

◆ read() [8/32]

void Ice::InputStream::read ( Int v)
inline

Reads an int from the stream.

Parameters
vThe extracted int.

◆ read() [9/32]

template<typename T >
void Ice::InputStream::read ( Int  tag,
IceUtil::Optional< T > &  v 
)
inline

Reads an optional data value from the stream.

Parameters
tagThe tag ID.
vHolds the extracted data (if any).

◆ read() [10/32]

void Ice::InputStream::read ( Long v)

Reads a long from the stream.

Parameters
vThe extracted long.

◆ read() [11/32]

void Ice::InputStream::read ( PatchFunc  patchFunc,
void *  patchAddr 
)
inline

Reads a value (instance of a Slice class) from the stream.

Parameters
patchFuncThe patch callback function.
patchAddrClosure data passed to the callback.

◆ read() [12/32]

void Ice::InputStream::read ( Short v)

Reads a short from the stream.

Parameters
vThe extracted short.

◆ read() [13/32]

void Ice::InputStream::read ( std::pair< const bool *, const bool * > &  v)

Reads a sequence of boolean values from the stream.

Parameters
vA pair of pointers into the internal marshaling buffer representing the start and end of the sequence elements.

◆ read() [14/32]

void Ice::InputStream::read ( std::pair< const Byte *, const Byte * > &  v)

Reads a sequence of bytes from the stream.

Parameters
vA pair of pointers into the internal marshaling buffer representing the start and end of the sequence elements.

◆ read() [15/32]

void Ice::InputStream::read ( std::pair< const double *, const double * > &  v)

Reads a sequence of doubles from the stream.

Parameters
vA pair of pointers representing the start and end of the sequence elements.

◆ read() [16/32]

void Ice::InputStream::read ( std::pair< const float *, const float * > &  v)

Reads a sequence of floats from the stream.

Parameters
vA pair of pointers representing the start and end of the sequence elements.

◆ read() [17/32]

void Ice::InputStream::read ( std::pair< const int *, const int * > &  v)

Reads a sequence of ints from the stream.

Parameters
vA pair of pointers representing the start and end of the sequence elements.

◆ read() [18/32]

void Ice::InputStream::read ( std::pair< const long long *, const long long * > &  v)

Reads a sequence of longs from the stream.

Parameters
vA pair of pointers representing the start and end of the sequence elements.

◆ read() [19/32]

void Ice::InputStream::read ( std::pair< const short *, const short * > &  v)

Reads a sequence of boolean values from the stream.

Parameters
vA pair of pointers representing the start and end of the sequence elements.

◆ read() [20/32]

template<typename T >
void Ice::InputStream::read ( std::pair< const T *, const T * > &  v)
inline

Extracts a sequence of data values from the stream.

Parameters
vA pair of pointers representing the beginning and end of the sequence elements.

◆ read() [21/32]

void Ice::InputStream::read ( std::string &  v,
bool  convert = true 
)

Reads a string from the stream.

Parameters
vThe extracted string.
convertDetermines whether the string is processed by the string converter, if one is installed. The default behavior is to convert strings.

◆ read() [22/32]

void Ice::InputStream::read ( std::vector< bool > &  v)

Reads a sequence of boolean values from the stream.

Parameters
vA vector to hold a copy of the boolean values.

◆ read() [23/32]

void Ice::InputStream::read ( std::vector< Byte > &  v)

Reads a sequence of bytes from the stream.

Parameters
vA vector to hold a copy of the bytes.

◆ read() [24/32]

void Ice::InputStream::read ( std::vector< Double > &  v)

Reads a sequence of doubles from the stream.

Parameters
vA vector to hold a copy of the double values.

◆ read() [25/32]

void Ice::InputStream::read ( std::vector< Float > &  v)

Reads a sequence of floats from the stream.

Parameters
vA vector to hold a copy of the float values.

◆ read() [26/32]

void Ice::InputStream::read ( std::vector< Int > &  v)

Reads a sequence of ints from the stream.

Parameters
vA vector to hold a copy of the int values.

◆ read() [27/32]

void Ice::InputStream::read ( std::vector< Long > &  v)

Reads a sequence of longs from the stream.

Parameters
vA vector to hold a copy of the long values.

◆ read() [28/32]

void Ice::InputStream::read ( std::vector< Short > &  v)

Reads a sequence of shorts from the stream.

Parameters
vA vector to hold a copy of the short values.

◆ read() [29/32]

void Ice::InputStream::read ( std::vector< std::string > &  v,
bool  convert = true 
)

Reads a sequence of strings from the stream.

Parameters
vThe extracted string sequence.
convertDetermines whether strings are processed by the string converter, if one is installed. The default behavior is to convert the strings.

◆ read() [30/32]

void Ice::InputStream::read ( std::vector< std::wstring > &  v)

Reads a sequence of wide strings from the stream.

Parameters
vThe extracted sequence.

◆ read() [31/32]

void Ice::InputStream::read ( std::wstring &  v)

Reads a wide string from the stream.

Parameters
vThe extracted string.

◆ read() [32/32]

template<typename T >
void Ice::InputStream::read ( T &  v)
inline

Reads a data value from the stream.

Parameters
vHolds the extracted data.

◆ readAll() [1/4]

template<typename T >
void Ice::InputStream::readAll ( std::initializer_list< int >  tags,
IceUtil::Optional< T > &  v 
)
inline

Reads a list of optional data values.

◆ readAll() [2/4]

template<typename T , typename... Te>
void Ice::InputStream::readAll ( std::initializer_list< int >  tags,
IceUtil::Optional< T > &  v,
IceUtil::Optional< Te > &...  ve 
)
inline

Reads a list of optional data values.

◆ readAll() [3/4]

template<typename T >
void Ice::InputStream::readAll ( T &  v)
inline

Reads a list of mandatory data values.

◆ readAll() [4/4]

template<typename T , typename... Te>
void Ice::InputStream::readAll ( T &  v,
Te &...  ve 
)
inline

Reads a list of mandatory data values.

◆ readAndCheckSeqSize()

Int Ice::InputStream::readAndCheckSeqSize ( int  minSize)

Reads and validates a sequence size.

Parameters
minSizeThe minimum size required by the sequence type.
Returns
The extracted size.

◆ readBlob() [1/2]

void Ice::InputStream::readBlob ( const Byte *&  v,
Container::size_type  sz 
)
inline

Reads a blob of bytes from the stream.

Parameters
vA pointer into the internal marshaling buffer representing the start of the blob.
szThe number of bytes to read.

◆ readBlob() [2/2]

void Ice::InputStream::readBlob ( std::vector< Byte > &  bytes,
Int  sz 
)

Reads a blob of bytes from the stream.

Parameters
bytesThe vector to hold a copy of the bytes from the marshaling buffer.
szThe number of bytes to read.

◆ readEncapsulation()

EncodingVersion Ice::InputStream::readEncapsulation ( const Byte *&  v,
Int sz 
)
inline

Returns a blob of bytes representing an encapsulation.

Parameters
vA pointer into the internal marshaling buffer representing the start of the encoded encapsulation.
szThe number of bytes in the encapsulation.
Returns
encoding The encapsulation's encoding version.

◆ readEnum()

Int Ice::InputStream::readEnum ( Int  maxValue)

Reads an enumerator from the stream.

Parameters
maxValueThe maximum enumerator value in the definition.
Returns
The enumerator value.

◆ readOptional()

bool Ice::InputStream::readOptional ( Int  tag,
OptionalFormat  expectedFormat 
)
inline

Determine if an optional value is available for reading.

Parameters
tagThe tag associated with the value.
expectedFormatThe optional format for the value.
Returns
True if the value is present, false otherwise.

◆ readPendingValues()

void Ice::InputStream::readPendingValues ( )

Indicates that unmarshaling is complete, except for any class instances.

The application must call this method only if the stream actually contains class instances. Calling readPendingValues triggers the patch callbacks to inform the application that unmarshaling of an instance is complete.

◆ readProxy()

std::shared_ptr<ObjectPrx> Ice::InputStream::readProxy ( )

Reads a proxy from the stream.

Returns
The proxy as the base ObjectPrx type.

◆ readSize()

Int Ice::InputStream::readSize ( )
inline

Extracts a size from the stream.

Returns
The extracted size.

◆ resize()

void Ice::InputStream::resize ( Container::size_type  sz)
inline

Resizes the stream to a new size.

Parameters
szThe new size.

◆ setClassGraphDepthMax()

void Ice::InputStream::setClassGraphDepthMax ( size_t  n)

Sets an upper limit on the depth of a class graph.

If this limit is exceeded during unmarshaling, the stream raises MarshalException.

Parameters
nThe maximum depth.

◆ setClosure()

void* Ice::InputStream::setClosure ( void *  p)

Associates closure data with this stream.

Parameters
pThe data as a void pointer.
Returns
The previous closure data, or nil.

◆ setCompactIdResolver()

void Ice::InputStream::setCompactIdResolver ( std::function< std::string(int)>  r)

Sets the compact ID resolver to use when unmarshaling value and exception instances.

If the stream was initialized with a communicator, the communicator's resolver will be used by default.

Parameters
rThe compact ID resolver.

◆ setLogger()

void Ice::InputStream::setLogger ( const LoggerPtr &  logger)

Sets the logger to use when logging trace messages.

If the stream was initialized with a communicator, the communicator's logger will be used by default.

Parameters
loggerThe logger to use for logging trace messages.

◆ setSliceValues()

void Ice::InputStream::setSliceValues ( bool  b)

Indicates whether to slice instances of Slice classes to a known Slice type when a more derived type is unknown.

An instance is "sliced" when no static information is available for a Slice type ID and no factory can be found for that type, resulting in the creation of an instance of a less-derived type. If slicing is disabled in this situation, the stream raises the exception NoValueFactoryException. The default behavior is to allow slicing.

Parameters
bTrue to enable slicing, false otherwise.

◆ setTraceSlicing()

void Ice::InputStream::setTraceSlicing ( bool  b)

Indicates whether to log messages when instances of Slice classes are sliced.

If the stream is initialized with a communicator, this setting defaults to the value of the Ice.Trace.Slicing property, otherwise the setting defaults to false.

Parameters
bTrue to enable logging, false otherwise.

◆ setValueFactoryManager()

void Ice::InputStream::setValueFactoryManager ( const ValueFactoryManagerPtr &  vfm)

Sets the value factory manager to use when unmarshaling value instances.

If the stream was initialized with a communicator, the communicator's value factory manager will be used by default.

Parameters
vfmThe value factory manager.

◆ skip()

void Ice::InputStream::skip ( size_type  size)
inline

Advances the current stream position by the given number of bytes.

Parameters
sizeThe number of bytes to skip.

◆ skipEmptyEncapsulation()

EncodingVersion Ice::InputStream::skipEmptyEncapsulation ( )
inline

Skips an empty encapsulation.

Returns
The encapsulation's encoding version.

◆ skipEncapsulation()

EncodingVersion Ice::InputStream::skipEncapsulation ( )

Skips over an encapsulation.

Returns
The encoding version of the skipped encapsulation.

◆ skipOptional()

void Ice::InputStream::skipOptional ( OptionalFormat  format)

Skips one optional value with the given format.

Parameters
formatThe expected format of the optional, if present.

◆ skipOptionals()

void Ice::InputStream::skipOptionals ( )

Skips all remaining optional values.

◆ skipSize()

void Ice::InputStream::skipSize ( )
inline

Reads a size at the current position and skips that number of bytes.

◆ skipSlice()

void Ice::InputStream::skipSlice ( )
inline

Skips over a value or exception slice.

◆ startEncapsulation()

const EncodingVersion& Ice::InputStream::startEncapsulation ( )
inline

Reads the start of an encapsulation.

Returns
The encoding version used by the encapsulation.

◆ startException()

void Ice::InputStream::startException ( )
inline

Marks the start of a user exception.

◆ startSlice()

std::string Ice::InputStream::startSlice ( )
inline

Reads the start of a value or exception slice.

Returns
The Slice type ID for this slice.

◆ startValue()

void Ice::InputStream::startValue ( )
inline

Marks the start of a class instance.

◆ swap()

void Ice::InputStream::swap ( InputStream other)

Swaps the contents of one stream with another.

Parameters
otherThe other stream.

◆ throwException()

void Ice::InputStream::throwException ( UserExceptionFactory  factory = nullptr)

Extracts a user exception from the stream and throws it.

Parameters
factoryIf provided, this factory is given the first opportunity to instantiate the exception. If not provided, or if the factory does not throw an exception when invoked, the stream will attempt to instantiate the exception using static type information.
Exceptions
UserExceptionThe user exception that was unmarshaled.

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