sapling/cstore/datastore.h
Mihails Smolins 38c4cde5a3 cstore: extend and refactor deltachain class
Summary:
Extended DeltaChain with CDeltaChain and PyDeltaChain which are wrappers around
c and python delta chains respectively. The declaration and implementation
of c and python delta chains as well as DeltaChainLink were put in a different
file.

Test Plan: * Ensure that unit tests pass

Reviewers: ryanmce, durham, simonfar, #fbhgext

Reviewed By: ryanmce, durham, #fbhgext

Differential Revision: https://phab.mercurial-scm.org/D630
2017-09-07 08:07:30 -07:00

37 lines
849 B
C++

// Copyright (c) 2004-present, Facebook, Inc.
// All Rights Reserved.
//
// This software may be used and distributed according to the terms of the
// GNU General Public License version 2 or any later version.
// datastore.h - c++ declarations for a data store
// no-check-code
#ifndef FBHGEXT_DATASTORE_H
#define FBHGEXT_DATASTORE_H
#include <memory>
#include "cstore/deltachain.h"
#include "cstore/key.h"
class DataStore {
protected:
DataStore() {}
public:
virtual ~DataStore() {}
virtual DeltaChainIterator getDeltaChain(const Key &key) = 0;
virtual std::shared_ptr<DeltaChain> getDeltaChainRaw(const Key &key) = 0;
virtual std::shared_ptr<KeyIterator> getMissing(KeyIterator &missing) = 0;
virtual bool contains(const Key &key) = 0;
virtual void markForRefresh() = 0;
};
#endif // FBHGEXT_DATASTORE_H