pytorch/caffe2/distributed/file_store_handler.h
cyy 483f748dd5 [BE] Enforce missing override keyword (#104032)
This PR enables `-Winconsistent-missing-destructor-override` and `-Winconsistent-missing-override`
and fixes violations.

<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 47e904e</samp>

This pull request updates the code of various classes and operators in the `caffe2` and `aten` subdirectories to use the `override` specifier instead of the `virtual` keyword for destructors and other virtual functions that override a base class function. This improves the code readability, quality, and consistency with C++ best practices. It also modifies the `./CMakeLists.txt` file to enable warnings for these specifiers, but disable errors.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/104032
Approved by: https://github.com/malfet
2023-06-24 02:34:24 +00:00

41 lines
1.0 KiB
C++

#pragma once
#include <caffe2/distributed/store_handler.h>
namespace caffe2 {
class TORCH_API FileStoreHandler : public StoreHandler {
public:
explicit FileStoreHandler(const std::string& path, const std::string& prefix);
~FileStoreHandler() override;
void set(const std::string& name, const std::string& data) override;
virtual std::string get(
const std::string& name,
const std::chrono::milliseconds& timeout = kDefaultTimeout) override;
int64_t add(const std::string& name, int64_t value) override;
bool deleteKey(const std::string& key) override;
int64_t getNumKeys() override;
bool check(const std::vector<std::string>& names) override;
virtual void wait(
const std::vector<std::string>& names,
const std::chrono::milliseconds& timeout = kDefaultTimeout) override;
protected:
std::string basePath_;
std::string realPath(const std::string& path);
std::string tmpPath(const std::string& name);
std::string objectPath(const std::string& name);
};
} // namespace caffe2