Ice 3.7 C++11 API Reference
FactoryTable.h
Go to the documentation of this file.
1 //
2 // Copyright (c) ZeroC, Inc. All rights reserved.
3 //
4 
5 #ifndef ICE_FACTORYTABLE_H
6 #define ICE_FACTORYTABLE_H
7 
8 #include <IceUtil/Mutex.h>
10 #include <Ice/ValueFactory.h>
11 
12 namespace Ice
13 {
14 
21 {
22 public:
23 
29  virtual ::std::string resolve(Ice::Int id) const = 0;
30 };
32 
33 }
34 
35 namespace IceInternal
36 {
37 
38 class ICE_API FactoryTable : private IceUtil::noncopyable
39 {
40 public:
41 
42  void addExceptionFactory(const ::std::string&, ICE_IN(ICE_DELEGATE(::Ice::UserExceptionFactory)));
43  ICE_DELEGATE(::Ice::UserExceptionFactory) getExceptionFactory(const ::std::string&) const;
44  void removeExceptionFactory(const ::std::string&);
45 
46  void addValueFactory(const ::std::string&, ICE_IN(ICE_DELEGATE(::Ice::ValueFactory)));
47  ICE_DELEGATE(::Ice::ValueFactory) getValueFactory(const ::std::string&) const;
48  void removeValueFactory(const ::std::string&);
49 
50  void addTypeId(int, const ::std::string&);
51  std::string getTypeId(int) const;
52  void removeTypeId(int);
53 
54 private:
55 
56  IceUtil::Mutex _m;
57 
58  typedef ::std::pair< ICE_DELEGATE(::Ice::UserExceptionFactory), int> EFPair;
59  typedef ::std::map< ::std::string, EFPair> EFTable;
60  EFTable _eft;
61 
62  typedef ::std::pair< ICE_DELEGATE(::Ice::ValueFactory), int> VFPair;
63  typedef ::std::map< ::std::string, VFPair> VFTable;
64  VFTable _vft;
65 
66  typedef ::std::pair< ::std::string, int> TypeIdPair;
67  typedef ::std::map<int, TypeIdPair> TypeIdTable;
68  TypeIdTable _typeIdTable;
69 };
70 
71 }
72 
73 #endif
Ice::CompactIdResolver::resolve
virtual ::std::string resolve(Ice::Int id) const =0
Called by the Ice run time when a compact ID must be translated into a type ID.
Ice::CompactIdResolver
The base class for a compact ID resolver.
Definition: FactoryTable.h:21
ICE_API
#define ICE_API
Definition: Config.h:197
ValueFactory.h
ICE_IN
#define ICE_IN(...)
Definition: Config.h:370
IceUtil::noncopyable
Definition: Config.h:313
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
IceUtil::Mutex
Definition: Mutex.h:33
Mutex.h
Ice
Definition: BuiltinSequences.h:56
IceUtil::Handle
Definition: Handle.h:143
UserExceptionFactory.h
Ice::CompactIdResolverPtr
IceUtil::Handle< CompactIdResolver > CompactIdResolverPtr
Definition: FactoryTable.h:31
Ice::UserExceptionFactory
std::function< void(const std::string &)> UserExceptionFactory
Creates and throws a user exception.
Definition: UserExceptionFactory.h:18
Ice::Int
int Int
The mapping for the Slice int type.
Definition: Config.h:54
IceUtil::Shared
Definition: Shared.h:78
ICE_DELEGATE
#define ICE_DELEGATE(T)
Definition: Config.h:369