ICE 3.4.2
[php5-ice-freebsdport.git] / slice / Ice / ObjectFactory.ice
blobf98a91cc9e0c2c0a98836ef45504ee4bffb0a5f2
1 // **********************************************************************
2 //
3 // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
4 //
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
7 //
8 // **********************************************************************
10 #ifndef ICE_OBJECT_FACTORY_ICE
11 #define ICE_OBJECT_FACTORY_ICE
13 [["cpp:header-ext:h"]]
15 module Ice
18 /**
19  *
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.
25  *
26  * @see Freeze
27  *
28  **/
29 local interface ObjectFactory
31     /**
32      *
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>.
38      *
39      * <p class="Note">The leading "<tt>::</tt>" is required.
40      *
41      * @param type The object type.
42      *
43      * @return The object created for the given type, or nil if the
44      * factory is unable to create the object.
45      *
46      **/
47     Object create(string type);
49     /**
50      *
51      * Called when the factory is removed from the communicator, or if
52      * the communicator is destroyed.
53      *
54      * @see Communicator#destroy
55      *
56      **/
57     void destroy();
62 #endif