/usr/include/caffe/util/db.hpp is in libcaffe-cpu-dev 1.0.0~rc4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | #ifndef CAFFE_UTIL_DB_HPP
#define CAFFE_UTIL_DB_HPP
#include <string>
#include "caffe/common.hpp"
#include "caffe/proto/caffe.pb.h"
namespace caffe { namespace db {
enum Mode { READ, WRITE, NEW };
class Cursor {
public:
Cursor() { }
virtual ~Cursor() { }
virtual void SeekToFirst() = 0;
virtual void Next() = 0;
virtual string key() = 0;
virtual string value() = 0;
virtual bool valid() = 0;
DISABLE_COPY_AND_ASSIGN(Cursor);
};
class Transaction {
public:
Transaction() { }
virtual ~Transaction() { }
virtual void Put(const string& key, const string& value) = 0;
virtual void Commit() = 0;
DISABLE_COPY_AND_ASSIGN(Transaction);
};
class DB {
public:
DB() { }
virtual ~DB() { }
virtual void Open(const string& source, Mode mode) = 0;
virtual void Close() = 0;
virtual Cursor* NewCursor() = 0;
virtual Transaction* NewTransaction() = 0;
DISABLE_COPY_AND_ASSIGN(DB);
};
DB* GetDB(DataParameter::DB backend);
DB* GetDB(const string& backend);
} // namespace db
} // namespace caffe
#endif // CAFFE_UTIL_DB_HPP
|