New 4DSSE Code 0.0.1a
 
Loading...
Searching...
No Matches
Metadata.h
Go to the documentation of this file.
1#ifndef METADATA_H
2#define METADATA_H
3
4#if defined(__APPLE__) || defined(__linux__)
5#define EXPORT_SYMBOL __attribute__((visibility("default")))
6#else
7#define EXPORT_SYMBOL
8#endif
9
10#include <string>
11#include <vector>
12#include <cstddef>
13#include <iostream>
14
22
31class EXPORT_SYMBOL Metadata {
32public:
36 Metadata() = default;
37
46 Metadata(std::size_t byteSize, std::string dataType, std::vector<std::size_t> dimensions, bool debugFlag = false);
47
52 [[nodiscard]] std::size_t getByteSize() const noexcept;
53
58 void setByteSize(std::size_t byteSize) noexcept;
59
64 [[nodiscard]] const std::string& getDataType() const noexcept;
65
70 void setDataType(const std::string& dataType);
71
76 [[nodiscard]] const std::vector<std::size_t>& getDimensions() const noexcept;
77
82 void setDimensions(const std::vector<std::size_t>& dimensions);
83
88 [[nodiscard]] bool isDebugEnabled() const noexcept;
89
94 void setDebugEnabled(bool debugFlag) noexcept;
95
103 friend std::ostream& operator<<(std::ostream& os, const Metadata& metadata);
104
105private:
106 std::size_t byteSize_ = 0;
107 std::string dataType_;
108 std::vector<std::size_t> dimensions_;
109 bool debugFlag_ = false;
110};
111
112#endif // METADATA_H
void setByteSize(std::size_t byteSize) noexcept
Sets the total size of the data in bytes.
Definition Metadata.cpp:42
void setDebugEnabled(bool debugFlag) noexcept
Sets the debugging flag.
Definition Metadata.cpp:112
const std::vector< std::size_t > & getDimensions() const noexcept
Gets the dimensions of the data.
Definition Metadata.cpp:78
void setDataType(const std::string &dataType)
Sets the type of the data.
Definition Metadata.cpp:66
bool isDebugEnabled() const noexcept
Checks if debugging information is enabled.
Definition Metadata.cpp:100
std::size_t getByteSize() const noexcept
Gets the total size of the data in bytes.
Definition Metadata.cpp:30
Metadata()=default
Default constructor for Metadata.
const std::string & getDataType() const noexcept
Gets the type of the data.
Definition Metadata.cpp:54
void setDimensions(const std::vector< std::size_t > &dimensions)
Sets the dimensions of the data.
Definition Metadata.cpp:89