Ice 3.7 C++11 API Reference
ValueFactory.h
Go to the documentation of this file.
1 //
2 // Copyright (c) ZeroC, Inc. All rights reserved.
3 //
4 //
5 // Ice version 3.7.10
6 //
7 // <auto-generated>
8 //
9 // Generated from file `ValueFactory.ice'
10 //
11 // Warning: do not edit this file.
12 //
13 // </auto-generated>
14 //
15 
16 #ifndef __Ice_ValueFactory_h__
17 #define __Ice_ValueFactory_h__
18 
20 #include <Ice/ProxyF.h>
21 #include <Ice/ObjectF.h>
22 #include <Ice/ValueF.h>
23 #include <Ice/Exception.h>
24 #include <Ice/LocalObject.h>
25 #include <Ice/StreamHelpers.h>
26 #include <Ice/Comparable.h>
27 #include <IceUtil/ScopedArray.h>
28 #include <Ice/Optional.h>
29 #include <IceUtil/UndefSysMacros.h>
30 
31 #ifndef ICE_IGNORE_VERSION
32 # if ICE_INT_VERSION / 100 != 307
33 # error Ice version mismatch!
34 # endif
35 # if ICE_INT_VERSION % 100 >= 50
36 # error Beta header file detected
37 # endif
38 # if ICE_INT_VERSION % 100 < 10
39 # error Ice patch level mismatch!
40 # endif
41 #endif
42 
43 #ifndef ICE_API
44 # if defined(ICE_STATIC_LIBS)
45 # define ICE_API
46 # elif defined(ICE_API_EXPORTS)
47 # define ICE_API ICE_DECLSPEC_EXPORT
48 # else
49 # define ICE_API ICE_DECLSPEC_IMPORT
50 # endif
51 #endif
52 
53 #ifdef ICE_CPP11_MAPPING // C++11 mapping
54 
55 namespace Ice
56 {
57 
58 class ValueFactoryManager;
59 
60 }
61 
62 namespace Ice
63 {
64 
77 using ValueFactory = ::std::function<::std::shared_ptr<Value>(const ::std::string& type)>;
78 
86 class ICE_CLASS(ICE_API) ValueFactoryManager
87 {
88 public:
89 
91 
132  virtual void add(ValueFactory factory, const ::std::string& id) = 0;
133 
141  virtual ::Ice::ValueFactory find(const ::std::string& id) const noexcept = 0;
142 };
143 
144 }
145 
147 namespace Ice
148 {
149 
150 }
152 
154 namespace Ice
155 {
156 
157 using ValueFactoryManagerPtr = ::std::shared_ptr<ValueFactoryManager>;
158 
159 }
161 
162 #else // C++98 mapping
163 
164 namespace Ice
165 {
166 
167 class ValueFactory;
169 ICE_API LocalObject* upCast(ValueFactory*);
171 typedef ::IceInternal::Handle< ValueFactory> ValueFactoryPtr;
172 
173 class ValueFactoryManager;
175 ICE_API LocalObject* upCast(ValueFactoryManager*);
177 typedef ::IceInternal::Handle< ValueFactoryManager> ValueFactoryManagerPtr;
178 
179 }
180 
181 namespace Ice
182 {
183 
192 class ICE_API ValueFactory : public virtual LocalObject
193 {
194 public:
195 
196  typedef ValueFactoryPtr PointerType;
197 
198  virtual ~ValueFactory();
199 
200 #ifdef ICE_CPP11_COMPILER
201  ValueFactory() = default;
202  ValueFactory(const ValueFactory&) = default;
203  ValueFactory& operator=(const ValueFactory&) = default;
204 #endif
205 
218  virtual ValuePtr create(const ::std::string& type) = 0;
219 };
220 
222 inline bool operator==(const ValueFactory& lhs, const ValueFactory& rhs)
223 {
224  return static_cast<const LocalObject&>(lhs) == static_cast<const LocalObject&>(rhs);
225 }
226 
227 inline bool operator<(const ValueFactory& lhs, const ValueFactory& rhs)
228 {
229  return static_cast<const LocalObject&>(lhs) < static_cast<const LocalObject&>(rhs);
230 }
232 
240 class ICE_API ValueFactoryManager : public virtual LocalObject
241 {
242 public:
243 
244  typedef ValueFactoryManagerPtr PointerType;
245 
246  virtual ~ValueFactoryManager();
247 
248 #ifdef ICE_CPP11_COMPILER
249  ValueFactoryManager() = default;
250  ValueFactoryManager(const ValueFactoryManager&) = default;
251  ValueFactoryManager& operator=(const ValueFactoryManager&) = default;
252 #endif
253 
294  virtual void add(const ValueFactoryPtr& factory, const ::std::string& id) = 0;
295 
303  virtual ValueFactoryPtr find(const ::std::string& id) const ICE_NOEXCEPT = 0;
304 };
305 
307 inline bool operator==(const ValueFactoryManager& lhs, const ValueFactoryManager& rhs)
308 {
309  return static_cast<const LocalObject&>(lhs) == static_cast<const LocalObject&>(rhs);
310 }
311 
312 inline bool operator<(const ValueFactoryManager& lhs, const ValueFactoryManager& rhs)
313 {
314  return static_cast<const LocalObject&>(lhs) < static_cast<const LocalObject&>(rhs);
315 }
317 
318 }
319 
321 namespace Ice
322 {
323 
324 }
326 
327 #endif
328 
330 #endif
Optional.h
StreamHelpers.h
Ice::operator==
bool operator==(const C &lhs, const C &rhs)
Relational operator for generated structs and classes.
Definition: Comparable.h:184
Ice::upCast
IceUtil::Shared * upCast(::Ice::LocalObject *)
ICE_NOEXCEPT
#define ICE_NOEXCEPT
Definition: Config.h:128
ICE_API
#define ICE_API
Definition: Config.h:197
ICE_MEMBER
#define ICE_MEMBER(API)
Definition: Config.h:177
Ice::ValueFactoryManager::add
virtual void add(ValueFactory factory, const ::std::string &id)=0
Add a value factory.
LocalObject.h
PushDisableWarnings.h
ProxyF.h
Ice::operator<
bool operator<(const C &lhs, const C &rhs)
Relational operator for generated structs and classes.
Definition: Comparable.h:136
Ice::ValueFactoryManager::find
virtual ::Ice::ValueFactory find(const ::std::string &id) const noexcept=0
Find an value factory registered with this communicator.
Ice::ValueFactoryManager
A value factory manager maintains a collection of value factories.
Definition: ValueFactory.h:87
Ice::ValueFactory
::std::function<::std::shared_ptr< Value >(const ::std::string &type)> ValueFactory
Create a new value for a given value type.
Definition: ValueFactory.h:77
UndefSysMacros.h
ObjectF.h
Ice
Definition: BuiltinSequences.h:56
Ice::ValueFactoryManager::~ValueFactoryManager
virtual ~ValueFactoryManager()
Comparable.h
ScopedArray.h
Exception.h
ValueF.h
PopDisableWarnings.h