strus  0.17
databaseOptions.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Patrick P. Frey
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
10 #ifndef _STRUS_DATABASE_OPTIONS_HPP_INCLUDED
11 #define _STRUS_DATABASE_OPTIONS_HPP_INCLUDED
12 
13 namespace strus
14 {
15 
18 {
19 public:
22  :m_opt(0){}
25  :m_opt(o.m_opt){}
27  DatabaseOptions( unsigned int opt_)
28  :m_opt(opt_){}
29 
31  DatabaseOptions& useCache( bool yes=true)
32  {
33  if (yes) m_opt |= UseCache; else m_opt &= ~UseCache;
34  return *this;
35  }
36 
38  bool useCacheEnabled() const
39  {
40  return m_opt & UseCache;
41  }
42 
44  unsigned int opt() const
45  {
46  return m_opt;
47  }
48 
49 private:
50  unsigned int m_opt;
51  enum {UseCache=1};
52 };
53 
54 }//namespace
55 #endif
56 
bool useCacheEnabled() const
Test flag for caching the values read in an LRU cache.
Definition: databaseOptions.hpp:38
unsigned int opt() const
Get the options transacription as integer.
Definition: databaseOptions.hpp:44
DatabaseOptions & useCache(bool yes=true)
Enable caching of visited key/value elements or blocks.
Definition: databaseOptions.hpp:31
DatabaseOptions(unsigned int opt_)
Constructor.
Definition: databaseOptions.hpp:27
Structure for passing some options to the strus key value storage database.
Definition: databaseOptions.hpp:17
DatabaseOptions()
Default constructor.
Definition: databaseOptions.hpp:21
DatabaseOptions(const DatabaseOptions &o)
Copy constructor.
Definition: databaseOptions.hpp:24