diff options
author | Michi Henning <michi@zeroc.com> | 2003-05-08 05:46:29 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2003-05-08 05:46:29 +0000 |
commit | 225855fb6b992a4207f9107d988036aa1ee0d217 (patch) | |
tree | efa68b5ed0afbc0753e7b8d98786674262caa872 /cpp/include/Ice/FactoryTableDef.h | |
parent | more install projects (diff) | |
download | ice-225855fb6b992a4207f9107d988036aa1ee0d217.tar.bz2 ice-225855fb6b992a4207f9107d988036aa1ee0d217.tar.xz ice-225855fb6b992a4207f9107d988036aa1ee0d217.zip |
Merged HEAD and slicing trees.
Diffstat (limited to 'cpp/include/Ice/FactoryTableDef.h')
-rw-r--r-- | cpp/include/Ice/FactoryTableDef.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/cpp/include/Ice/FactoryTableDef.h b/cpp/include/Ice/FactoryTableDef.h new file mode 100644 index 00000000000..b8a4096df08 --- /dev/null +++ b/cpp/include/Ice/FactoryTableDef.h @@ -0,0 +1,73 @@ +// ********************************************************************** +// +// Copyright (c) 2003 +// ZeroC, Inc. +// Billerica, MA, USA +// +// All Rights Reserved. +// +// Ice is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License version 2 as published by +// the Free Software Foundation. +// +// ********************************************************************** + +#ifndef ICE_FACTORYTABLEDEF_H +#define ICE_FACTORYTABLEDEF_H + +#include <IceUtil/Mutex.h> +#include <Ice/UserExceptionFactory.h> +#include <Ice/ObjectFactory.h> +#include <string> +#include <map> + +namespace Ice +{ + +class ICE_API FactoryTableDef : public IceUtil::noncopyable +{ +public: + + void addExceptionFactory(const ::std::string&, const Ice::UserExceptionFactoryPtr&); + Ice::UserExceptionFactoryPtr getExceptionFactory(const ::std::string&) const; + void removeExceptionFactory(const ::std::string&); + + void addObjectFactory(const ::std::string&, const Ice::ObjectFactoryPtr&); + Ice::ObjectFactoryPtr getObjectFactory(const ::std::string&) const; + void removeObjectFactory(const ::std::string&); + +private: + + IceUtil::Mutex _m; + + typedef ::std::pair<Ice::UserExceptionFactoryPtr, int> EFPair; + typedef ::std::map< ::std::string, EFPair> EFTable; + EFTable _eft; + + typedef ::std::pair<Ice::ObjectFactoryPtr, int> OFPair; + typedef ::std::map< ::std::string, OFPair> OFTable; + OFTable _oft; +}; + +class ICE_API FactoryTableWrapper : IceUtil::noncopyable +{ +public: + + friend class FactoryTable; + + FactoryTableWrapper(); + ~FactoryTableWrapper(); + +private: + + void initialize(); + void finalize(); + IceUtil::Mutex _m; + static int _initCount; +}; + +extern FactoryTableWrapper factoryTableWrapper; + +} + +#endif |