16 #ifndef __Ice_ValueFactory_h__
17 #define __Ice_ValueFactory_h__
31 #ifndef ICE_IGNORE_VERSION
32 # if ICE_INT_VERSION / 100 != 307
33 # error Ice version mismatch!
35 # if ICE_INT_VERSION % 100 >= 50
36 # error Beta header file detected
38 # if ICE_INT_VERSION % 100 < 10
39 # error Ice patch level mismatch!
44 # if defined(ICE_STATIC_LIBS)
46 # elif defined(ICE_API_EXPORTS)
47 # define ICE_API ICE_DECLSPEC_EXPORT
49 # define ICE_API ICE_DECLSPEC_IMPORT
53 #ifdef ICE_CPP11_MAPPING // C++11 mapping
58 class ValueFactoryManager;
77 using ValueFactory = ::std::function<::std::shared_ptr<Value>(const ::std::string& type)>;
157 using ValueFactoryManagerPtr = ::std::shared_ptr<ValueFactoryManager>;
162 #else // C++98 mapping
171 typedef ::IceInternal::Handle< ValueFactory> ValueFactoryPtr;
173 class ValueFactoryManager;
177 typedef ::IceInternal::Handle< ValueFactoryManager> ValueFactoryManagerPtr;
196 typedef ValueFactoryPtr PointerType;
200 #ifdef ICE_CPP11_COMPILER
218 virtual ValuePtr create(const ::std::string& type) = 0;
224 return static_cast<const LocalObject&
>(lhs) ==
static_cast<const LocalObject&
>(rhs);
229 return static_cast<const LocalObject&
>(lhs) <
static_cast<const LocalObject&
>(rhs);
240 class ICE_API ValueFactoryManager :
public virtual LocalObject
244 typedef ValueFactoryManagerPtr PointerType;
246 virtual ~ValueFactoryManager();
248 #ifdef ICE_CPP11_COMPILER
249 ValueFactoryManager() =
default;
250 ValueFactoryManager(
const ValueFactoryManager&) =
default;
251 ValueFactoryManager& operator=(
const ValueFactoryManager&) =
default;
294 virtual void add(
const ValueFactoryPtr& factory, const ::std::string&
id) = 0;
303 virtual ValueFactoryPtr find(const ::std::string&
id)
const ICE_NOEXCEPT = 0;
307 inline bool operator==(
const ValueFactoryManager& lhs,
const ValueFactoryManager& rhs)
309 return static_cast<const LocalObject&
>(lhs) ==
static_cast<const LocalObject&
>(rhs);
312 inline bool operator<(
const ValueFactoryManager& lhs,
const ValueFactoryManager& rhs)
314 return static_cast<const LocalObject&
>(lhs) <
static_cast<const LocalObject&
>(rhs);