-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
258 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// (c) Copyright 2019 DESY,ESS,Eugen Wintersberger <[email protected]> | ||
// | ||
// This file is part of h5cpp. | ||
// | ||
// This library is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU Lesser General Public License as published | ||
// by the Free Software Foundation; either version 2.1 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This library is distributed in the hope that it will be useful, but | ||
// WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY | ||
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
// License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with this library; if not, write to the | ||
// Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor | ||
// Boston, MA 02110-1301 USA | ||
// =========================================================================== | ||
// | ||
// Author: Eugen Wintersberger <[email protected]> | ||
// Created on: Jan 12, 2019 | ||
// | ||
|
||
|
||
#include <h5cpp/node/group_info.hpp> | ||
|
||
namespace hdf5 { | ||
namespace node { | ||
|
||
StorageType GroupInfo::storage_type() const noexcept | ||
{ | ||
return static_cast<StorageType>(_info.storage_type); | ||
} | ||
|
||
size_t GroupInfo::number_of_links() const noexcept | ||
{ | ||
return _info.nlinks; | ||
} | ||
|
||
bool GroupInfo::has_file_mounted() const noexcept | ||
{ | ||
return _info.mounted; | ||
} | ||
|
||
int64_t GroupInfo::maximum_corder() const noexcept | ||
{ | ||
return _info.max_corder; | ||
} | ||
|
||
|
||
} // end of namespace node | ||
} // end of namespace hdf5 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// | ||
// (c) Copyright 2019 DESY,ESS,Eugen Wintersberger <[email protected]> | ||
// | ||
// This file is part of h5cpp. | ||
// | ||
// This library is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU Lesser General Public License as published | ||
// by the Free Software Foundation; either version 2.1 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This library is distributed in the hope that it will be useful, but | ||
// WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY | ||
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
// License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with this library; if not, write to the | ||
// Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor | ||
// Boston, MA 02110-1301 USA | ||
// =========================================================================== | ||
// | ||
// Author: Eugen Wintersberger <[email protected]> | ||
// Created on: Jan 12, 2019 | ||
// | ||
#pragma once | ||
|
||
extern "C" { | ||
#include <hdf5.h> | ||
} | ||
|
||
#include <h5cpp/node/types.hpp> | ||
|
||
namespace hdf5 { | ||
namespace node { | ||
|
||
class GroupInfo | ||
{ | ||
private: | ||
H5G_info_t _info; | ||
public: | ||
|
||
StorageType storage_type() const noexcept; | ||
|
||
size_t number_of_links() const noexcept; | ||
|
||
bool has_file_mounted() const noexcept; | ||
|
||
int64_t maximum_corder() const noexcept; | ||
|
||
explicit operator H5G_info_t() const noexcept | ||
{ | ||
return _info; | ||
} | ||
|
||
explicit operator H5G_info_t*() noexcept | ||
{ | ||
return &_info; | ||
} | ||
|
||
explicit operator const H5G_info_t*() const noexcept | ||
{ | ||
return &_info; | ||
} | ||
|
||
}; | ||
|
||
|
||
} // end of namespace node | ||
} // end of namespace hdf5 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// | ||
// (c) Copyright 2019 DESY,ESS, Eugen Wintersberger <[email protected]> | ||
// | ||
// This file is part of h5pp. | ||
// | ||
// This library is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU Lesser General Public License as published | ||
// by the Free Software Foundation; either version 2.1 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This library is distributed in the hope that it will be useful, but | ||
// WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY | ||
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
// License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with this library; if not, write to the | ||
// Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor | ||
// Boston, MA 02110-1301 USA | ||
// =========================================================================== | ||
// | ||
// Author: Eugen Wintersberger <[email protected]> | ||
// Created on: Jan 12, 2019 | ||
// | ||
|
||
#include <gtest/gtest.h> | ||
#include <h5cpp/hdf5.hpp> | ||
|
||
using namespace hdf5; | ||
|
||
TEST(StorageTypeTest,test_string_representation) | ||
{ | ||
std::stringstream stream; | ||
|
||
stream<<node::StorageType::UNKNOWN; | ||
EXPECT_EQ("UNKNOWN",stream.str()); | ||
|
||
stream.str(std::string()); | ||
stream<<node::StorageType::COMPACT; | ||
EXPECT_EQ("COMPACT",stream.str()); | ||
|
||
stream.str(std::string()); | ||
stream<<node::StorageType::DENSE; | ||
EXPECT_EQ("DENSE",stream.str()); | ||
|
||
stream.str(std::string()); | ||
stream<<node::StorageType::SYMBOL_TABLE; | ||
EXPECT_EQ("SYMBOL_TABLE",stream.str()); | ||
|
||
} | ||
|
||
|
||
TEST(StorageTypeTest,test_values) | ||
{ | ||
EXPECT_EQ(H5G_STORAGE_TYPE_UNKNOWN, | ||
static_cast<H5G_storage_type_t>(node::StorageType::UNKNOWN)); | ||
EXPECT_EQ(H5G_STORAGE_TYPE_COMPACT, | ||
static_cast<H5G_storage_type_t>(node::StorageType::COMPACT)); | ||
EXPECT_EQ(H5G_STORAGE_TYPE_DENSE, | ||
static_cast<H5G_storage_type_t>(node::StorageType::DENSE)); | ||
EXPECT_EQ(H5G_STORAGE_TYPE_SYMBOL_TABLE, | ||
static_cast<H5G_storage_type_t>(node::StorageType::SYMBOL_TABLE)); | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters