Store.h
Go to the documentation of this file.
1 /*
2  * Copyright 2006-2008 The FLWOR Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef API_STORE_H
18 #define API_STORE_H
19 
20 class Store
21 {
22 public:
23  Store() {}
24 
25  Store(const Store&) {}
26 
27  virtual ~Store() {}
28 
29  virtual void* getStore() const { return 0; }
30 
31 }; // class Store
32 
33 
34 /**
35  * Class contains helper functions to create and destroy the store that is
36  * to be used by the zorba library. The functions must be implemented in the
37  * code of each store module.
38  */
39 class InMemoryStore : public Store
40 {
41 private:
42  void* theStore;
43 public:
44  InMemoryStore() : theStore(0) {}
45 
46  InMemoryStore(const InMemoryStore& aStore) : Store(aStore), theStore(aStore.theStore) {}
47 
48  InMemoryStore(void* aStore) : theStore(aStore) {}
49 
50  virtual ~InMemoryStore() {}
51 
52  InMemoryStore& operator=(const InMemoryStore& aStore);
53  static InMemoryStore getInstance();
54  static void shutdown(InMemoryStore&);
55  virtual void* getStore() const;
56 };
57 
58 #endif
InMemoryStore(const InMemoryStore &aStore)
Definition: Store.h:46
virtual ~Store()
Definition: Store.h:27
InMemoryStore(void *aStore)
Definition: Store.h:48
virtual ~InMemoryStore()
Definition: Store.h:50
Store()
Definition: Store.h:23
Store(const Store &)
Definition: Store.h:25
Definition: Store.h:20
virtual void * getStore() const
Definition: Store.h:29
static InMemoryStore getInstance()
Class contains helper functions to create and destroy the store that is to be used by the zorba libra...
Definition: Store.h:39
static void shutdown(InMemoryStore &)
virtual void * getStore() const
InMemoryStore()
Definition: Store.h:44
InMemoryStore & operator=(const InMemoryStore &aStore)