sapling/ctreemanifest/manifest_fetcher.h
Durham Goode 1faefff046 treemanifest: convert all ownership Manifest references to ManifestPtr
Now that we have a ManifestPtr object, let's use it in all the places we
currently have Manifest ownership and cleanup happening. We don't need to fix up
any places that are just using Manifests from a readonly, non-lifetime related
perspective.

This gets rid of all the 'delete' calls on Manifest, except the one inside
~ManiestPtr;
2016-10-14 16:01:12 -07:00

40 lines
919 B
C++

// manifest_fetcher.h - c++ declarations for a fetcher for manifests
//
// Copyright 2016 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 REMOTEFILELOG_MANIFEST_FETCHER_H
#define REMOTEFILELOG_MANIFEST_FETCHER_H
#include "pythonutil.h"
#include <string>
class ManifestFetcher;
#include "manifest.h"
/**
* Class used to obtain Manifests, given a path and node.
*/
class ManifestFetcher {
private:
PythonObj _get;
public:
ManifestFetcher(PythonObj &store);
/**
* Fetches the Manifest from the store for the provided manifest key.
* Returns the manifest if found, or throws an exception if not found.
*/
ManifestPtr get(
const char *path, size_t pathlen,
std::string &node) const;
};
#endif //REMOTEFILELOG_MANIFEST_FETCHER_H