ICE 3.4.2
[php5-ice-freebsdport.git] / cpp / include / Ice / FactoryTable.h
blob987048629c10af5ffc4343d4b977d42c98e61e74
1 // **********************************************************************
2 //
3 // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
4 //
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
7 //
8 // **********************************************************************
10 #ifndef ICE_FACTORYTABLE_H
11 #define ICE_FACTORYTABLE_H
13 #include <IceUtil/Mutex.h>
14 #include <Ice/UserExceptionFactory.h>
15 #include <Ice/ObjectFactoryF.h>
16 #include <string>
17 #include <map>
19 namespace IceInternal
22 class ICE_API FactoryTable : private IceUtil::noncopyable
24 public:
26 void addExceptionFactory(const ::std::string&, const IceInternal::UserExceptionFactoryPtr&);
27 IceInternal::UserExceptionFactoryPtr getExceptionFactory(const ::std::string&) const;
28 void removeExceptionFactory(const ::std::string&);
30 void addObjectFactory(const ::std::string&, const Ice::ObjectFactoryPtr&);
31 Ice::ObjectFactoryPtr getObjectFactory(const ::std::string&) const;
32 void removeObjectFactory(const ::std::string&);
34 private:
36 IceUtil::Mutex _m;
38 typedef ::std::pair<IceInternal::UserExceptionFactoryPtr, int> EFPair;
39 typedef ::std::map< ::std::string, EFPair> EFTable;
40 EFTable _eft;
42 typedef ::std::pair<Ice::ObjectFactoryPtr, int> OFPair;
43 typedef ::std::map< ::std::string, OFPair> OFTable;
44 OFTable _oft;
49 #endif