ocarina/include/index.h
Anna Schumaker 1b34a9a8a0 index: Update the index design
I updated the design and rewrote the unit tests.  This creates something
more consistent with how I ended up using the index.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00

39 lines
662 B
C++

/*
* Copyright 2014 (c) Anna Schumaker.
*/
#ifndef OCARINA_INDEX_H
#define OCARINA_INDEX_H
#include <database.h>
#include <set>
#include <string>
class IndexEntry : public DatabaseEntry {
public:
std::string key;
std::set<unsigned int> values;
IndexEntry();
IndexEntry(const std::string &);
const std::string primary_key();
void insert(unsigned int);
void remove(unsigned int);
void write(File &);
void read(File &);
};
class Index : public Database<IndexEntry> {
public:
Index(const std::string &, bool);
void insert(const std::string &, unsigned int);
void remove(const std::string &, unsigned int);
};
#endif /* OCARINA_DATABASE_H */