Ice 3.7 C++98 API Reference
Loading...
Searching...
No Matches
Ice::ValueFactoryManager Class Referenceabstract

A value factory manager maintains a collection of value factories. More...

#include <Ice/Ice.h>

Inheritance diagram for Ice::ValueFactoryManager:
Collaboration diagram for Ice::ValueFactoryManager:

Public Types

typedef ValueFactoryManagerPtr PointerType

Public Member Functions

virtual void add (const ValueFactoryPtr &factory, const ::std::string &id)=0
 Add a value factory.
virtual ValueFactoryPtr find (const ::std::string &id) const throw () =0
 Find an value factory registered with this communicator.
virtual ~ValueFactoryManager ()
Public Member Functions inherited from Ice::LocalObject
virtual bool operator< (const LocalObject &) const
virtual bool operator== (const LocalObject &) const
Public Member Functions inherited from IceUtil::Shared
void __clearFlag (unsigned char flag)
virtual void __decRef ()
virtual int __getRef () const
bool __hasFlag (unsigned char flag)
virtual void __incRef ()
void __setFlag (unsigned char flag)
virtual void __setNoDelete (bool)
Sharedoperator= (const Shared &)
 Shared ()
 Shared (const Shared &)
virtual ~Shared ()

Additional Inherited Members

Static Public Attributes inherited from IceUtil::Shared
static const unsigned char NoDelete
Protected Attributes inherited from IceUtil::Shared
unsigned char _flags
IceUtilInternal::Atomic _ref

Detailed Description

A value factory manager maintains a collection of value factories.

An application can supply a custom implementation during communicator initialization, otherwise Ice provides a default implementation.

See also
ValueFactory

Member Typedef Documentation

◆ PointerType

Constructor & Destructor Documentation

◆ ~ValueFactoryManager()

virtual Ice::ValueFactoryManager::~ValueFactoryManager ( )
virtual

Member Function Documentation

◆ add()

virtual void Ice::ValueFactoryManager::add ( const ValueFactoryPtr & factory,
const ::std::string & id )
pure virtual

Add a value factory.

Attempting to add a factory with an id for which a factory is already registered throws AlreadyRegisteredException.

When unmarshaling an Ice value, the Ice run time reads the most-derived type id off the wire and attempts to create an instance of the type using a factory. If no instance is created, either because no factory was found, or because all factories returned nil, the behavior of the Ice run time depends on the format with which the value was marshaled:

If the value uses the "sliced" format, Ice ascends the class hierarchy until it finds a type that is recognized by a factory, or it reaches the least-derived type. If no factory is found that can create an instance, the run time throws NoValueFactoryException.

If the value uses the "compact" format, Ice immediately raises NoValueFactoryException.

The following order is used to locate a factory for a type:

  1. The Ice run-time looks for a factory registered specifically for the type.

  2. If no instance has been created, the Ice run-time looks for the default factory, which is registered with an empty type id.

  3. If no instance has been created by any of the preceding steps, the Ice run-time looks for a factory that may have been statically generated by the language mapping for non-abstract classes.

Parameters
factoryThe factory to add.
idThe type id for which the factory can create instances, or an empty string for the default factory.

◆ find()

virtual ValueFactoryPtr Ice::ValueFactoryManager::find ( const ::std::string & id) const
throw ( )
pure virtual

Find an value factory registered with this communicator.

Parameters
idThe type id for which the factory can create instances, or an empty string for the default factory.
Returns
The value factory, or null if no value factory was found for the given id.

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