1 // **********************************************************************
3 // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
8 // **********************************************************************
10 #ifndef ICE_OBJECT_FACTORY_ICE
11 #define ICE_OBJECT_FACTORY_ICE
13 [["cpp:header-ext:h"]]
20 * A factory for objects. Object factories are used in several
21 * places, for example, when receiving "objects by value" and
22 * when Freeze restores a persistent object. Object factories
23 * must be implemented by the application writer, and registered
24 * with the communicator.
29 local interface ObjectFactory
33 * Create a new object for a given object type. The type is the
34 * absolute Slice type id, i.e., the id relative to the
35 * unnamed top-level Slice module. For example, the absolute
36 * Slice type id for interfaces of type <tt>Bar</tt> in the module
37 * <tt>Foo</tt> is <tt>::Foo::Bar</tt>.
39 * <p class="Note">The leading "<tt>::</tt>" is required.
41 * @param type The object type.
43 * @return The object created for the given type, or nil if the
44 * factory is unable to create the object.
47 Object create(string type);
51 * Called when the factory is removed from the communicator, or if
52 * the communicator is destroyed.
54 * @see Communicator#destroy