From a3615e9e1fa2bea608a8f3a8b68c6af8977a248f Mon Sep 17 00:00:00 2001 From: Vito G Castellana Date: Sun, 6 Mar 2022 17:24:47 -0800 Subject: [PATCH] [#204] Local data getters for hasmap, multimap and set --- include/shad/data_structures/hashmap.h | 7 +++++++ include/shad/data_structures/multimap.h | 7 +++++++ include/shad/data_structures/set.h | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/include/shad/data_structures/hashmap.h b/include/shad/data_structures/hashmap.h index ae56e3e6..87998187 100644 --- a/include/shad/data_structures/hashmap.h +++ b/include/shad/data_structures/hashmap.h @@ -107,6 +107,13 @@ class Hashmap : public AbstractDataStructure< /// @return The global identifier associated with the hashmap instance. ObjectID GetGlobalID() const { return oid_; } + /// @brief Getter of the local hasmap. + /// + /// @return The pointer to the local hashmap instance. + LocalHashmap * GetLocalHashmap() { + return & localMap_; + }; + /// @brief Overall size of the hashmap (number of entries). /// @warning Calling the size method may result in one-to-all /// communication among localities to retrieve consinstent information. diff --git a/include/shad/data_structures/multimap.h b/include/shad/data_structures/multimap.h index 0b224587..7527c780 100644 --- a/include/shad/data_structures/multimap.h +++ b/include/shad/data_structures/multimap.h @@ -111,6 +111,13 @@ class Multimap : public AbstractDataStructure< Multimap * GetLocalMultimap() { + return &localMultimap_; + }; + /// @brief Overall size of the multimap (number of entries). /// @warning Calling the size method may result in one-to-all /// communication among localities to retrieve consistent information. diff --git a/include/shad/data_structures/set.h b/include/shad/data_structures/set.h index 935f66b1..75062da8 100644 --- a/include/shad/data_structures/set.h +++ b/include/shad/data_structures/set.h @@ -83,6 +83,13 @@ class Set : public AbstractDataStructure> { /// @return The global identifier associated with the set instance. ObjectID GetGlobalID() const { return oid_; } + /// @brief Getter of the local set. + /// + /// @return The pointer to the local set instance. + LocalSet * GetLocalSet() { + return & localSet_; + }; + /// @brief Overall size of the set (number of elements). /// @warning Calling the size method may result in one-to-all /// communication among localities to retrieve consinstent information.