Lunchbox  1.9.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
persistentMap.h
1 
2 /* Copyright (c) 2014, Stefan.Eilemann@epfl.ch
3  *
4  * This library is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License version 2.1 as published
6  * by the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11  * details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library; if not, write to the Free Software Foundation, Inc.,
15  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16  */
17 
18 #ifndef LUNCHBOX_PERSISTENTMAP_H
19 #define LUNCHBOX_PERSISTENTMAP_H
20 
21 #include <lunchbox/api.h>
22 #include <boost/noncopyable.hpp>
23 #include <iostream>
24 #include <string>
25 
26 namespace lunchbox
27 {
28 namespace detail { class PersistentMap; }
29 
35 class PersistentMap : public boost::noncopyable
36 {
37 public:
50  LUNCHBOX_API PersistentMap( const std::string& uri = std::string( ));
51 
53  LUNCHBOX_API ~PersistentMap();
54 
63  LUNCHBOX_API bool insert( const std::string& key, const std::string& value);
64 
72  LUNCHBOX_API std::string operator [] ( const std::string& key ) const;
73 
74 private:
75  detail::PersistentMap* const _impl;
76 };
77 
78 // inline std::ostream& operator << ( std::ostream& os, const PersistentMap& m )
79 
80 }
81 
82 #endif //LUNCHBOX_PERSISTENTMAP_H
Defines export visibility macros for Lunchbox.
LUNCHBOX_API PersistentMap(const std::string &uri=std::string())
Construct a new persistent map.
LUNCHBOX_API ~PersistentMap()
Destruct the persistent map.
Unified interface to save key-value pairs in a persistent store.
Definition: persistentMap.h:35
LUNCHBOX_API bool insert(const std::string &key, const std::string &value)
Insert or update a value in the database.
LUNCHBOX_API std::string operator[](const std::string &key) const
Retrieve a value for a key.