Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use uint64_t for topic id in hdf5 #1883

Merged
merged 3 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions contrib/ecalhdf5/src/hdf5_helper.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2024 - 2025 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ========================= eCAL LICENSE =================================
*/

#include "hdf5_helper.h"

bool CreateStringEntryInRoot(hid_t root, const std::string& url, const std::string& dataset_content)
Expand Down
22 changes: 20 additions & 2 deletions contrib/ecalhdf5/src/hdf5_helper.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2024 - 2025 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ========================= eCAL LICENSE =================================
*/

#pragma once

#include <string>
Expand Down Expand Up @@ -54,8 +73,7 @@ inline std::string printHex(eCAL::experimental::measurement::base::Channel::id_t

inline eCAL::experimental::measurement::base::Channel::id_t parseHexID(std::string string_id)
{
auto unsigned_value = std::stoull(string_id, 0, 16);
return static_cast<eCAL::experimental::measurement::base::Channel::id_t>(unsigned_value);
return std::stoull(string_id, nullptr, 16);
}

namespace v6
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2024 Continental Corporation
* Copyright (C) 2016 - 2025 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,6 +26,7 @@

#include <cstdint>
#include <set>
#include <string>
#include <tuple>
#include <vector>

Expand Down Expand Up @@ -68,7 +69,7 @@ namespace eCAL

struct Channel
{
using id_t = std::int64_t;
using id_t = std::uint64_t;

std::string name = "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no type named 'string' in namespace 'std' [clang-diagnostic-error]

          std::string name = "";
               ^

id_t id = 0;
Expand Down
3 changes: 1 addition & 2 deletions tests/contrib/ecalhdf5/hdf5_test/src/hdf5_test.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2024 Continental Corporation
* Copyright (C) 2016 - 2025 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1032,7 +1032,6 @@ TEST(HDF5, PrintParseHex)
std::vector<Channel::id_t> numeric_values =
{
0,
-1,
1,
std::numeric_limits<Channel::id_t>::min(),
std::numeric_limits<Channel::id_t>::max()
Expand Down
Loading