|
Mila 0.13.48
Deep Neural Network Library
|
Interface for hierarchical archive serializers. More...


Public Member Functions | |
| virtual | ~ArchiveSerializer ()=default |
| virtual bool | addData (const std::string &path, const void *data, size_t size)=0 |
| Add a binary blob to the archive at a hierarchical path. | |
| virtual bool | addMetadata (const std::string &key, const std::string &value)=0 |
| Add metadata entry. | |
| virtual size_t | extractData (const std::string &path, void *data, size_t size)=0 |
| Extract a file from the archive. | |
| virtual size_t | getFileSize (const std::string &path) const =0 |
| Get file size at path. | |
| virtual std::string | getMetadata (const std::string &key) const =0 |
| Get metadata entry. | |
| virtual bool | hasFile (const std::string &path) const =0 |
| Check if file exists at path. | |
| virtual std::vector< std::string > | listFiles () const =0 |
| List all files in the archive. | |
| Public Member Functions inherited from Mila::Dnn::Serialization::Serializer | |
| virtual | ~Serializer ()=default |
| virtual bool | close ()=0 |
| Close the file. | |
| virtual const std::string & | getFilename () const noexcept=0 |
| Get the filename. | |
| virtual bool | isOpen () const noexcept=0 |
| Check if currently open. | |
| virtual bool | isOpenForRead () const noexcept=0 |
| Check if open for reading. | |
| virtual bool | isOpenForWrite () const noexcept=0 |
| Check if open for writing. | |
| virtual bool | open (const std::string &filename, OpenMode mode)=0 |
| Open a file for reading or writing. | |
Interface for hierarchical archive serializers.
Archive serializers work with hierarchical file structures where resources are organized in directory trees. Used by ModelArchive for Mila's internal checkpoint format.
Examples: ZipSerializer, TarSerializer
|
virtualdefault |
|
nodiscardpure virtual |
Add a binary blob to the archive at a hierarchical path.
| path | Hierarchical path (e.g., "network/components/layer1/weight.bin") |
| data | Pointer to source bytes |
| size | Number of bytes |
Implemented in Mila::Dnn::Serialization::ZipSerializer.
|
nodiscardpure virtual |
Add metadata entry.
Implemented in Mila::Dnn::Serialization::ZipSerializer.
|
nodiscardpure virtual |
Extract a file from the archive.
| path | Hierarchical path |
| data | Pre-allocated buffer |
| size | Buffer size |
Implemented in Mila::Dnn::Serialization::ZipSerializer.
|
nodiscardpure virtual |
Get file size at path.
Implemented in Mila::Dnn::Serialization::ZipSerializer.
|
nodiscardpure virtual |
Get metadata entry.
Implemented in Mila::Dnn::Serialization::ZipSerializer.
|
nodiscardpure virtual |
Check if file exists at path.
Implemented in Mila::Dnn::Serialization::ZipSerializer.
|
nodiscardpure virtual |
List all files in the archive.
Implemented in Mila::Dnn::Serialization::ZipSerializer.