Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
PluginFactory.h
1// Copyright (c) ZeroC, Inc.
2
3#ifndef ICE_PLUGIN_FACTORY_H
4#define ICE_PLUGIN_FACTORY_H
5
6#include "CommunicatorF.h"
7#include "Config.h"
8#include "Ice/BuiltinSequences.h"
9#include "Plugin.h"
10
11#include <string>
12
13namespace Ice
14{
15 class Plugin;
16
17 /// A plug-in factory function responsible for creating an Ice plug-in.
18 /// For plug-ins that may be loaded dynamically, these functions are extern "C" to avoid name mangling.
19 /// @param communicator The communicator in which the plug-in will be installed.
20 /// @param name The name assigned to the plug-in.
21 /// @param args Additional arguments included in the plug-in's configuration.
22 /// @return The new plug-in object.
23 using PluginFactoryFunc = Plugin* (*)(const CommunicatorPtr& communicator,
24 const std::string& name,
25 const StringSeq& args);
26
27 /// Represents a plug-in factory.
28 /// @see InitializeData::pluginFactories
30 {
31 /// The default and preferred name for plug-ins created by this factory.
32 std::string pluginName;
33
34 /// The factory function.
36 };
37
38 // Transport plug-ins provided by the Ice library.
39
40 /// Returns the factory for the UDP transport plug-in, IceUDP.
41 /// @return The factory for the IceUDP plug-in.
42 /// @remark You only need to call this function if you are using static libraries. The Ice shared library adds the
43 /// IceUDP plug-in automatically.
44 /// @see InitializationData::pluginFactories
46
47 /// Returns the factory for the WebSocket transport plug-in, IceWS.
48 /// @return The factory for the IceWS plug-in.
49 /// @remark You only need to call this function if you are using static libraries. The Ice shared library adds the
50 /// IceWS plug-in automatically.
51 /// @see InitializationData::pluginFactories
53
54#if (defined(__APPLE__) && TARGET_OS_IPHONE != 0) || defined(ICE_DOXYGEN)
55 /// Returns the factory for the iAP transport plug-in, IceIAP.
56 /// @return The factory for the IceIAP plug-in.
57 /// @see InitializationData::pluginFactories
59#endif
60
61 /// @cond INTERNAL
62 // Not exported because they are always registered by the Ice library.
63 PluginFactory tcpPluginFactory();
64 PluginFactory sslPluginFactory();
65 /// @endcond
66}
67
68namespace IceInternal
69{
70 /// Indicates whether the current Ice library provides the minimum set of built-in plug-ins, namely IceTCP and
71 /// IceSSL.
72 /// @return `true` when the Ice library provides the minimum set of built-in plug-ins, `false` when it also provides
73 /// IceUDP and IceWS.
74 ICE_API bool isMinBuild();
75}
76
77#endif
Represents a communicator plug-in.
Definition Plugin.h:18
std::shared_ptr< Communicator > CommunicatorPtr
A shared pointer to a Communicator.
Plugin *(*)(const CommunicatorPtr &communicator, const std::string &name, const StringSeq &args) PluginFactoryFunc
A plug-in factory function responsible for creating an Ice plug-in.
PluginFactory udpPluginFactory()
Returns the factory for the UDP transport plug-in, IceUDP.
PluginFactory iapPluginFactory()
Returns the factory for the iAP transport plug-in, IceIAP.
std::vector< std::string > StringSeq
A sequence of strings.
PluginFactory wsPluginFactory()
Returns the factory for the WebSocket transport plug-in, IceWS.
The Ice RPC framework.
Definition SampleEvent.h:59
PluginFactoryFunc factoryFunc
The factory function.
std::string pluginName
The default and preferred name for plug-ins created by this factory.
Represents a plug-in factory.