Loading...
Searching...
No Matches
Metadata.h
Go to the documentation of this file.
#ifndef METADATA_H
#define METADATA_H
#if defined(__APPLE__) || defined(__linux__)
#define EXPORT_SYMBOL __attribute__((visibility("default")))
#else
#define EXPORT_SYMBOL
#endif
#include <string>
#include <vector>
#include <cstddef>
#include <iostream>
class EXPORT_SYMBOL Metadata {
public:
Metadata() = default;
Metadata(std::size_t byteSize, std::string dataType, std::vector<std::size_t> dimensions, bool debugFlag = false);
[[nodiscard]] std::size_t getByteSize() const noexcept;
void setByteSize(std::size_t byteSize) noexcept;
[[nodiscard]] const std::string& getDataType() const noexcept;
void setDataType(const std::string& dataType);
[[nodiscard]] const std::vector<std::size_t>& getDimensions() const noexcept;
void setDimensions(const std::vector<std::size_t>& dimensions);
[[nodiscard]] bool isDebugEnabled() const noexcept;
void setDebugEnabled(bool debugFlag) noexcept;
friend std::ostream& operator<<(std::ostream& os, const Metadata& metadata);
private:
std::size_t byteSize_ = 0;
std::string dataType_;
std::vector<std::size_t> dimensions_;
bool debugFlag_ = false;
};
#endif // METADATA_H
Metadata::setByteSize
void setByteSize(std::size_t byteSize) noexcept
Sets the total size of the data in bytes.
Definition Metadata.cpp:42
Metadata::setDebugEnabled
void setDebugEnabled(bool debugFlag) noexcept
Sets the debugging flag.
Definition Metadata.cpp:112
Metadata::getDimensions
const std::vector< std::size_t > & getDimensions() const noexcept
Gets the dimensions of the data.
Definition Metadata.cpp:78
Metadata::setDataType
void setDataType(const std::string &dataType)
Sets the type of the data.
Definition Metadata.cpp:66
Metadata::isDebugEnabled
bool isDebugEnabled() const noexcept
Checks if debugging information is enabled.
Definition Metadata.cpp:100
Metadata::getByteSize
std::size_t getByteSize() const noexcept
Gets the total size of the data in bytes.
Definition Metadata.cpp:30
Metadata::Metadata
Metadata()=default
Default constructor for Metadata.
Metadata::getDataType
const std::string & getDataType() const noexcept
Gets the type of the data.
Definition Metadata.cpp:54
Metadata::setDimensions
void setDimensions(const std::vector< std::size_t > &dimensions)
Sets the dimensions of the data.
Definition Metadata.cpp:89