15 #ifndef SERIALBOX_CORE_ARCHIVE_ARCHIVE_H 16 #define SERIALBOX_CORE_ARCHIVE_ARCHIVE_H 45 const std::shared_ptr<FieldMetainfoImpl> info) = 0;
53 std::shared_ptr<FieldMetainfoImpl> info)
const = 0;
59 virtual std::string
name()
const = 0;
65 virtual std::string
directory()
const = 0;
68 virtual std::string
prefix()
const = 0;
74 virtual void clear() = 0;
86 virtual std::ostream&
toStream(std::ostream& stream)
const = 0;
virtual std::ostream & toStream(std::ostream &stream) const =0
Convert the archive to stream.
virtual void read(StorageView &storageView, const FieldID &fieldID, std::shared_ptr< FieldMetainfoImpl > info) const =0
Read the field identified by fieldID and given by storageView from disk.
virtual std::string prefix() const =0
Prefix of all files.
virtual void updateMetaData()=0
Update the meta-data on disk.
friend std::ostream & operator<<(std::ostream &stream, const Archive &archive)
Convert to stream.
virtual std::string directory() const =0
Directory to write/read files.
Represent a mutable view to a multi-dimensional storage.
Namespace of the serialbox library.
virtual std::string metaDataFile() const =0
Full file path to the meta-data file.
Uniquely identifiy a field.
virtual bool isWritingThreadSafe() const
Indicate whether it's safe for multiple threads to call Archive::write.
virtual bool isReadingThreadSafe() const
Indicate whether it's safe for multiple threads to call Archive::read.
virtual std::string name() const =0
Name of the archive.
virtual FieldID write(const StorageView &storageView, const std::string &field, const std::shared_ptr< FieldMetainfoImpl > info)=0
Write the field given by storageView to disk.
virtual ~Archive()
Vritual destructor.
virtual bool isSlicedReadingSupported() const
Indicate whether the archive supports StorageViews with attached slices.
OpenModeKind
Policy for opening files in the Serializer and Archive.
virtual void clear()=0
Clear the archive i.e remove all data from disk and reset the internal data-structures.
virtual OpenModeKind mode() const =0
Open-policy of the archive.
Abstract interface for Archives.