15 #ifndef SERIALBOX_CORE_ARCHIVE_MOCKARCHIVE_H 16 #define SERIALBOX_CORE_ARCHIVE_MOCKARCHIVE_H 36 static const std::string
Name;
45 const std::shared_ptr<FieldMetainfoImpl> info)
override;
48 std::shared_ptr<FieldMetainfoImpl> info)
const override;
54 virtual std::string
directory()
const override {
return directory_; }
56 virtual std::string
prefix()
const override {
return prefix_; }
60 virtual std::string
metaDataFile()
const override {
return metaDataFile_; }
62 virtual std::ostream&
toStream(std::ostream& stream)
const override;
64 virtual void clear()
override {}
75 std::string directory_;
77 std::string metaDataFile_;
virtual bool isReadingThreadSafe() const override
Indicate whether it's safe for multiple threads to call Archive::read.
virtual void updateMetaData() override
Update the meta-data on disk.
virtual void read(StorageView &storageView, const FieldID &fieldID, std::shared_ptr< FieldMetainfoImpl > info) const override
Read the field identified by fieldID and given by storageView from disk.
virtual std::string metaDataFile() const override
Full file path to the meta-data file.
Represent a mutable view to a multi-dimensional storage.
Namespace of the serialbox library.
Uniquely identifiy a field.
virtual std::ostream & toStream(std::ostream &stream) const override
Convert the archive to stream.
virtual bool isWritingThreadSafe() const override
Indicate whether it's safe for multiple threads to call Archive::write.
virtual FieldID write(const StorageView &storageView, const std::string &fieldID, const std::shared_ptr< FieldMetainfoImpl > info) override
Write the field given by storageView to disk.
virtual std::string name() const override
Name of the archive.
OpenModeKind
Policy for opening files in the Serializer and Archive.
static const std::string Name
Name of the Mock archive.
virtual bool isSlicedReadingSupported() const override
Indicate whether the archive supports StorageViews with attached slices.
virtual void clear() override
Clear the archive i.e remove all data from disk and reset the internal data-structures.
virtual std::string directory() const override
Directory to write/read files.
virtual OpenModeKind mode() const override
Open-policy of the archive.
virtual std::string prefix() const override
Prefix of all files.
MockArchive(OpenModeKind mode)
Initialize the archive.
Abstract interface for Archives.