Skip to content

Commit

Permalink
Make getMap private as public access is no longer necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed May 16, 2024
1 parent 44df0d2 commit 797386f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions include/podio/GenericParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
#include <string>
#include <vector>

#if PODIO_ENABLE_SIO
namespace sio {
class read_device;
class write_device;
using version_type = uint32_t; // from sio/definitions
} // namespace sio
#endif

#if PODIO_ENABLE_RNTUPLE
namespace podio {
Expand Down Expand Up @@ -127,9 +129,10 @@ class GenericParameters {
friend RNTupleWriter;
#endif

private:
/// Get a reference to the internal map for a given type
template <typename T>
const MapType<detail::GetVectorType<T>>& getMap() const {
MapType<detail::GetVectorType<T>>& getMap() {
if constexpr (std::is_same_v<detail::GetVectorType<T>, int>) {
return _intMap;
} else if constexpr (std::is_same_v<detail::GetVectorType<T>, float>) {
Expand All @@ -141,10 +144,9 @@ class GenericParameters {
}
}

private:
/// Get a reference to the internal map for a given type (necessary for SIO)
/// Get a reference to the internal map for a given type
template <typename T>
MapType<detail::GetVectorType<T>>& getMap() {
const MapType<detail::GetVectorType<T>>& getMap() const {
if constexpr (std::is_same_v<detail::GetVectorType<T>, int>) {
return _intMap;
} else if constexpr (std::is_same_v<detail::GetVectorType<T>, float>) {
Expand All @@ -156,7 +158,6 @@ class GenericParameters {
}
}

private:
/// Get the mutex that guards the map for the given type
template <typename T>
std::mutex& getMutex() const {
Expand Down

0 comments on commit 797386f

Please sign in to comment.