Skip to content

Commit

Permalink
Update members in BaseIO and HDF5IO
Browse files Browse the repository at this point in the history
  • Loading branch information
oruebel committed Sep 19, 2024
1 parent 131a914 commit e10535f
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 71 deletions.
16 changes: 11 additions & 5 deletions src/BaseIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,28 @@ const BaseDataType BaseDataType::DSTR = BaseDataType(T_STR, DEFAULT_STR_SIZE);

// BaseIO

BaseIO::BaseIO()
: readyToOpen(true)
, opened(false)
BaseIO::BaseIO(const std::string& filename)
: m_filename(filename)
, m_readyToOpen(true)
, m_opened(false)
{
}

BaseIO::~BaseIO() {}

bool BaseIO::isOpen() const
{
return opened;
return m_opened;
}

std::string BaseIO::getFileName()
{
return this->m_filename;
}

bool BaseIO::isReadyToOpen() const
{
return readyToOpen;
return m_readyToOpen;
}

bool BaseIO::canModifyObjects()
Expand Down
12 changes: 6 additions & 6 deletions src/BaseIO.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class BaseIO
/**
* @brief Constructor for the BaseIO class.
*/
BaseIO();
BaseIO(const std::string& filename);

/**
* @brief Copy constructor is deleted to prevent construction-copying.
Expand All @@ -115,7 +115,7 @@ class BaseIO
* @brief Returns the full path to the file.
* @return The full path to the file.
*/
virtual std::string getFileName() = 0;
virtual std::string getFileName();

/**
* @brief Opens the file for writing.
Expand Down Expand Up @@ -346,12 +346,12 @@ class BaseIO
*/
bool isReadyToOpen() const;

protected:
/**
* @brief The name of the file.
*/
const std::string filename;
const std::string m_filename;

protected:
/**
* @brief Creates a new group if it does not already exist.
* @param path The location of the group in the file.
Expand All @@ -362,12 +362,12 @@ class BaseIO
/**
* @brief Whether the file is ready to be opened.
*/
bool readyToOpen;
bool m_readyToOpen;

/**
* @brief Whether the file is currently open.
*/
bool opened;
bool m_opened;
};

/**
Expand Down
Loading

0 comments on commit e10535f

Please sign in to comment.