Loading...
Searching...
No Matches
Metadata.h
Go to the documentation of this file.
/* ***********************************************************************
//
// Copyright (C) 2025 -- The 4D-STAR Collaboration
// File Author: Emily Boudreaux
// Last Modified: March 17, 2025
//
// 4DSSE is free software; you can use it and/or modify
// it under the terms and restrictions the GNU General Library Public
// License version 3 (GPLv3) as published by the Free Software Foundation.
//
// 4DSSE is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public License
// along with this software; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// *********************************************************************** */
#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:
int byteSize_ = 0;
std::string dataType_;
std::vector<std::size_t> dimensions_;
bool debugFlag_ = false;
};
#endif // METADATA_H
EXPORT_SYMBOL
#define EXPORT_SYMBOL
Definition Metadata.h:27
Metadata::setByteSize
void setByteSize(std::size_t byteSize) noexcept
Sets the total size of the data in bytes.
Definition Metadata.cpp:62
Metadata::dimensions_
std::vector< std::size_t > dimensions_
Dimensions of the data (e.g., {3, 4} for a 3x4 matrix).
Definition Metadata.h:128
Metadata::dataType_
std::string dataType_
Type of the data (e.g., "float", "double").
Definition Metadata.h:127
Metadata::setDebugEnabled
void setDebugEnabled(bool debugFlag) noexcept
Sets the debugging flag.
Definition Metadata.cpp:132
Metadata::getDimensions
const std::vector< std::size_t > & getDimensions() const noexcept
Gets the dimensions of the data.
Definition Metadata.cpp:98
Metadata::debugFlag_
bool debugFlag_
Indicates whether debugging is enabled.
Definition Metadata.h:129
Metadata::setDataType
void setDataType(const std::string &dataType)
Sets the type of the data.
Definition Metadata.cpp:86
Metadata::isDebugEnabled
bool isDebugEnabled() const noexcept
Checks if debugging information is enabled.
Definition Metadata.cpp:120
Metadata::byteSize_
int byteSize_
Total size of the data in bytes.
Definition Metadata.h:126
Metadata::getByteSize
std::size_t getByteSize() const noexcept
Gets the total size of the data in bytes.
Definition Metadata.cpp:50
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:74
Metadata::setDimensions
void setDimensions(const std::vector< std::size_t > &dimensions)
Sets the dimensions of the data.
Definition Metadata.cpp:109