BDatabaseStore.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2005 Palmsource, Inc.
00003  * 
00004  * This software is licensed as described in the file LICENSE, which
00005  * you should have received as part of this distribution. The terms
00006  * are also available at http://www.openbinder.org/license.html.
00007  * 
00008  * This software consists of voluntary contributions made by many
00009  * individuals. For the exact contribution history, see the revision
00010  * history and logs, available at http://www.openbinder.org
00011  */
00012 
00013 #ifndef _STORAGE_BDATABASE_STORE_H
00014 #define _STORAGE_BDATABASE_STORE_H
00015 
00016 #include <support/MemoryStore.h>
00017 #include <storage/SDatabase.h>
00018 
00019 #include <DataMgr.h>
00020 
00021 #if _SUPPORTS_NAMESPACE
00022 namespace palmos {
00023 namespace storage {
00024 #endif
00025 
00026 class BDatabaseStore : public BMemoryStore
00027 {
00028 public:
00029 
00030                         BDatabaseStore(DatabaseID db, int32_t restype, DmResourceID resid);
00031                         BDatabaseStore(int32_t type, int32_t creator, int32_t restype, DmResourceID resid);
00032 
00033             status_t    ErrorCheck() const;
00034 
00035     DatabaseID          DbID() const;
00036 
00037 protected:
00038     virtual             ~BDatabaseStore();
00039 
00040 private:
00041                         BDatabaseStore(const BDatabaseStore&);
00042 
00043             void        init();
00044             void        open_resource(int32_t restype, DmResourceID resid);
00045 
00046     virtual void*       MoreCore(void *oldBuf, size_t newsize);
00047 
00048             SDatabase   m_db;
00049             MemHandle   m_handle;
00050             MemPtr      m_mem;
00051             size_t      m_length;
00052 };
00053 
00054 #if _SUPPORTS_NAMESPACE
00055 } } // namespace palmos::storage
00056 #endif
00057 
00058 #endif /* _STORAGE_BDATABASE_STORE_H */