Ice 3.7 C++11 API Reference
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Ice::UnexpectedObjectException Class Reference

This exception is raised if the type of an unmarshaled Slice class instance does not match its expected type. More...

#include <Ice/Ice.h>

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

Public Member Functions

virtual void ice_print (::std::ostream &stream) const override
 Prints this exception to the given stream. More...
 
std::tuple< const ::std::string &, const ::std::string &, const ::std::string & > ice_tuple () const
 Obtains a tuple containing all of the exception's data members. More...
 
 UnexpectedObjectException (const char *file, int line)
 The file and line number are required for all local exceptions. More...
 
 UnexpectedObjectException (const char *file, int line, const ::std::string &reason, const ::std::string &type, const ::std::string &expectedType)
 One-shot constructor to initialize all data members. More...
 
 UnexpectedObjectException (const UnexpectedObjectException &)=default
 
virtual ~UnexpectedObjectException ()
 
- Public Member Functions inherited from Ice::LocalExceptionHelper< UnexpectedObjectException, MarshalException >
virtual std::string ice_id () const override
 
- Public Member Functions inherited from IceUtil::ExceptionHelper< UnexpectedObjectException, MarshalException >
std::unique_ptr< UnexpectedObjectException > ice_clone () const
 
virtual void ice_throw () const override
 Throws this exception. More...
 

Static Public Member Functions

static const ::std::string & ice_staticId ()
 Obtains the Slice type ID of this exception. More...
 

Public Attributes

::std::string expectedType
 The Slice type ID that was expected by the receiving operation. More...
 
::std::string type
 The Slice type ID of the class instance that was unmarshaled. More...
 

Detailed Description

This exception is raised if the type of an unmarshaled Slice class instance does not match its expected type.

This can happen if client and server are compiled with mismatched Slice definitions or if a class of the wrong type is passed as a parameter or return value using dynamic invocation. This exception can also be raised if IceStorm is used to send Slice class instances and an operation is subscribed to the wrong topic.

Constructor & Destructor Documentation

◆ ~UnexpectedObjectException()

virtual Ice::UnexpectedObjectException::~UnexpectedObjectException ( )
virtual

◆ UnexpectedObjectException() [1/3]

Ice::UnexpectedObjectException::UnexpectedObjectException ( const UnexpectedObjectException )
default

◆ UnexpectedObjectException() [2/3]

Ice::UnexpectedObjectException::UnexpectedObjectException ( const char *  file,
int  line 
)
inline

The file and line number are required for all local exceptions.

Parameters
fileThe file name in which the exception was raised, typically __FILE__.
lineThe line number at which the exception was raised, typically __LINE__.

◆ UnexpectedObjectException() [3/3]

Ice::UnexpectedObjectException::UnexpectedObjectException ( const char *  file,
int  line,
const ::std::string &  reason,
const ::std::string &  type,
const ::std::string &  expectedType 
)
inline

One-shot constructor to initialize all data members.

The file and line number are required for all local exceptions.

Parameters
fileThe file name in which the exception was raised, typically __FILE__.
lineThe line number at which the exception was raised, typically __LINE__.
reasonThe reason for the failure.
typeThe Slice type ID of the class instance that was unmarshaled.
expectedTypeThe Slice type ID that was expected by the receiving operation.

Member Function Documentation

◆ ice_print()

virtual void Ice::UnexpectedObjectException::ice_print ( ::std::ostream &  stream) const
overridevirtual

Prints this exception to the given stream.

Parameters
streamThe target stream.

◆ ice_staticId()

static const ::std::string& Ice::UnexpectedObjectException::ice_staticId ( )
static

Obtains the Slice type ID of this exception.

Returns
The fully-scoped type ID.

◆ ice_tuple()

std::tuple<const ::std::string&, const ::std::string&, const ::std::string&> Ice::UnexpectedObjectException::ice_tuple ( ) const
inline

Obtains a tuple containing all of the exception's data members.

Returns
The data members in a tuple.

Member Data Documentation

◆ expectedType

::std::string Ice::UnexpectedObjectException::expectedType

The Slice type ID that was expected by the receiving operation.

◆ type

::std::string Ice::UnexpectedObjectException::type

The Slice type ID of the class instance that was unmarshaled.


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