mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 17:27:53 +03:00
a72478f016
Summary: This patch removes all `#include "../` lines and use the shortest possible include path. Test Plan: `make clean build` Reviewers: durham, #mercurial, rmcelroy Reviewed By: rmcelroy Subscribers: mjpieters Differential Revision: https://phabricator.intern.facebook.com/D5113672 Signature: t1:5113672:1495565454:961fb6f2f57a81a95013e0b8f67b2917c2e4523e
72 lines
1.6 KiB
C++
72 lines
1.6 KiB
C++
// uniondatapackstore.h - c++ declarations for a union datapack store
|
|
//
|
|
// Copyright 2017 Facebook, Inc.
|
|
//
|
|
// This software may be used and distributed according to the terms of the
|
|
// GNU General Public License version 2 or any later version.
|
|
//
|
|
// no-check-code
|
|
|
|
#ifndef UNIONDATAPACKSTORE_H
|
|
#define UNIONDATAPACKSTORE_H
|
|
|
|
extern "C" {
|
|
#include "cdatapack.h"
|
|
}
|
|
|
|
#include "key.h"
|
|
#include "datapackstore.h"
|
|
#include "store.h"
|
|
|
|
#include <cstring>
|
|
#include <vector>
|
|
#include <stdexcept>
|
|
|
|
class UnionDatapackStore;
|
|
class UnionDatapackStoreKeyIterator : public KeyIterator {
|
|
private:
|
|
UnionDatapackStore &_store;
|
|
KeyIterator &_missing;
|
|
|
|
public:
|
|
UnionDatapackStoreKeyIterator(UnionDatapackStore &store, KeyIterator &missing) :
|
|
_store(store),
|
|
_missing(missing) {}
|
|
|
|
Key *next();
|
|
};
|
|
|
|
class UnionDeltaChainIterator: public DeltaChainIterator {
|
|
private:
|
|
UnionDatapackStore &_store;
|
|
protected:
|
|
delta_chain_t getNextChain(const Key &key);
|
|
public:
|
|
UnionDeltaChainIterator(UnionDatapackStore &store, const Key &key) :
|
|
DeltaChainIterator(),
|
|
_store(store) {
|
|
_chains.push_back(this->getNextChain(key));
|
|
}
|
|
};
|
|
|
|
class UnionDatapackStore : public Store {
|
|
public:
|
|
std::vector<DatapackStore*> _stores;
|
|
|
|
UnionDatapackStore(std::vector<DatapackStore*> stores);
|
|
|
|
~UnionDatapackStore();
|
|
|
|
ConstantStringRef get(const Key &key);
|
|
|
|
UnionDeltaChainIterator getDeltaChain(const Key &key);
|
|
|
|
bool contains(const Key &key);
|
|
|
|
UnionDatapackStoreKeyIterator getMissing(KeyIterator &missing);
|
|
|
|
void markForRefresh();
|
|
};
|
|
|
|
#endif //UNIONDATAPACKSTORE_H
|