Mila 0.13.48
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Data::MilaFileHeader Class Referenceexport

Common file header for Mila data files. More...

Collaboration diagram for Mila::Data::MilaFileHeader:

Public Member Functions

 MilaFileHeader ()=default
 MilaFileHeader (MilaFileType type, SerializationMetadata metadata={})
MilaFileType getFileType () const
SerializationMetadatagetMetadata ()
const SerializationMetadatagetMetadata () const
void write (std::ostream &out) const

Static Public Member Functions

static MilaFileHeader read (std::istream &in)

Static Public Attributes

static constexpr uint32_t MAGIC = 0x4D494C41
static constexpr uint32_t VERSION = 1

Private Attributes

MilaFileType file_type_ = MilaFileType::Unknown
SerializationMetadata metadata_

Detailed Description

Common file header for Mila data files.

Structure:

  • Magic bytes: "MILA" (4 bytes) for file identification
  • Header version: uint32_t for future compatibility
  • File type: MilaFileType enum identifying content
  • Metadata size: uint32_t for variable-length metadata
  • Metadata: JSON-serialized SerializationMetadata

Followed by file-specific binary content.

Constructor & Destructor Documentation

◆ MilaFileHeader() [1/2]

Mila::Data::MilaFileHeader::MilaFileHeader ( )
default
Here is the caller graph for this function:

◆ MilaFileHeader() [2/2]

Mila::Data::MilaFileHeader::MilaFileHeader ( MilaFileType type,
SerializationMetadata metadata = {} )
inline

Member Function Documentation

◆ getFileType()

MilaFileType Mila::Data::MilaFileHeader::getFileType ( ) const
inline
Here is the caller graph for this function:

◆ getMetadata() [1/2]

SerializationMetadata & Mila::Data::MilaFileHeader::getMetadata ( )
inline

◆ getMetadata() [2/2]

const SerializationMetadata & Mila::Data::MilaFileHeader::getMetadata ( ) const
inline
Here is the caller graph for this function:

◆ read()

MilaFileHeader Mila::Data::MilaFileHeader::read ( std::istream & in)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write()

void Mila::Data::MilaFileHeader::write ( std::ostream & out) const
inline
Here is the caller graph for this function:

Member Data Documentation

◆ file_type_

MilaFileType Mila::Data::MilaFileHeader::file_type_ = MilaFileType::Unknown
private

◆ MAGIC

uint32_t Mila::Data::MilaFileHeader::MAGIC = 0x4D494C41
staticconstexpr

◆ metadata_

SerializationMetadata Mila::Data::MilaFileHeader::metadata_
private

◆ VERSION

uint32_t Mila::Data::MilaFileHeader::VERSION = 1
staticconstexpr

The documentation for this class was generated from the following file: