summaryrefslogtreecommitdiff
path: root/cpp/slice/Ice/ObjectFactory.ice
blob: 95b175d02f6534312ecebc2f15957ca139265c45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// **********************************************************************
//
// Copyright (c) 2001
// ZeroC, Inc.
// Huntsville, AL, USA
//
// All Rights Reserved
//
// **********************************************************************

#ifndef ICE_OBJECT_FACTORY_ICE
#define ICE_OBJECT_FACTORY_ICE

module Ice
{

/**
 *
 * A factory for objects. Object factories are used in several
 * places, for example, for receiving "objects by value" or for the
 * [Freeze] module. Object factories must be implemented by the
 * application writer, and installed with the communicator.
 *
 * @see Freeze
 * @see UserExceptionFactory
 *
 **/
local interface ObjectFactory
{
    /**
     *
     * Create a new object for a given object type. The type is the
     * absolute Slice type name, i.e., the the name relative to the
     * unnamed top-level Slice module. For example, the absolute Slice
     * type name for objects for interfaces of type [Bar] in the
     * module [Foo] is [::Foo::Bar].
     *
     * <note><para>The leading "[::]" is required.</para></note>
     *
     * @param type The object type.
     *
     * @return The object created for the given type.
     *
     **/
    Object create(string type);

    /**
     *
     * Called when the factory is removed from the communicator, or if
     * the communicator is destroyed.
     *
     * @see Communicator::removeObjectFactory
     * @see Communicator::destroy
     *
     **/
    void destroy();
};

};

#endif