diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2009-09-28 11:05:44 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2009-09-28 11:05:44 -0230 |
commit | 7d20430028f05cc26c412465176a75ce4ea5af9e (patch) | |
tree | 593695acf366f7e3a7081d15af8f474683ce4af7 /cpp/src/IceGrid/DatabaseCache.h | |
parent | Removed unused __checkTwoway(const char*) from Proxy (diff) | |
download | ice-7d20430028f05cc26c412465176a75ce4ea5af9e.tar.bz2 ice-7d20430028f05cc26c412465176a75ce4ea5af9e.tar.xz ice-7d20430028f05cc26c412465176a75ce4ea5af9e.zip |
Bug 3231 - alternative storage for IceGrid and IceStorm
Diffstat (limited to 'cpp/src/IceGrid/DatabaseCache.h')
-rw-r--r-- | cpp/src/IceGrid/DatabaseCache.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/cpp/src/IceGrid/DatabaseCache.h b/cpp/src/IceGrid/DatabaseCache.h new file mode 100644 index 00000000000..e1012695337 --- /dev/null +++ b/cpp/src/IceGrid/DatabaseCache.h @@ -0,0 +1,68 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#ifndef DATABASE_CACHE_H +#define DATABASE_CACHE_H + +#ifdef QTSQL +# include <IceSQL/SqlTypes.h> +# include <IceGrid/SqlStringApplicationInfoDict.h> +# include <IceGrid/SqlStringAdapterInfoDict.h> +# include <IceGrid/SqlIdentityObjectInfoDict.h> +#else +# include <Freeze/Freeze.h> +#endif + +namespace IceGrid +{ + +#ifdef QTSQL + +class DatabaseCache : public IceSQL::DatabaseCache +{ +public: + + DatabaseCache(const Ice::CommunicatorPtr&, const std::string&, const std::string&, const std::string&); + + const SqlStringApplicationInfoDictPtr applications; + const SqlStringAdapterInfoDictPtr adapters; + const SqlIdentityObjectInfoDictPtr objects; + const SqlIdentityObjectInfoDictPtr internalObjects; +}; + +typedef IceUtil::Handle<DatabaseCache> DatabaseCachePtr; + +#else + +typedef Freeze::ConnectionPtr DatabaseConnectionPtr; + +class DatabaseCache : public IceUtil::Shared +{ +public: + + DatabaseCache(const Ice::CommunicatorPtr&, const std::string&, const std::string&, const std::string&); + + DatabaseConnectionPtr getConnection(); + DatabaseConnectionPtr newConnection(); + +private: + + const Ice::CommunicatorPtr _communicator; + const std::string _envName; + const DatabaseConnectionPtr _connection; +}; + +typedef IceUtil::Handle<DatabaseCache> DatabaseCachePtr; + +#endif + + +} + +#endif |