Code Review
/
ric-plt
/
e2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "version 4.0.8 change typo in sub_id replace redirection cout (<<) with buffer...
[ric-plt/e2.git]
/
RIC-E2-TERMINATION
/
mapWrapper.h
diff --git
a/RIC-E2-TERMINATION/mapWrapper.h
b/RIC-E2-TERMINATION/mapWrapper.h
index
fa997da
..
ffa0eb3
100644
(file)
--- a/
RIC-E2-TERMINATION/mapWrapper.h
+++ b/
RIC-E2-TERMINATION/mapWrapper.h
@@
-15,6
+15,12
@@
* limitations under the License.
*/
* limitations under the License.
*/
+/*
+ * This source code is part of the near-RT RIC (RAN Intelligent Controller)
+ * platform project (RICP).
+ */
+
+
//
// Created by adi ENZEL on 8/28/19.
//
//
// Created by adi ENZEL on 8/28/19.
//
@@
-29,15
+35,10
@@
#include <string>
#include <iostream>
#include <string>
#include <iostream>
-using namespace std;
-
class mapWrapper {
public:
void *find(char *key) {
class mapWrapper {
public:
void *find(char *key) {
- shared_lock<shared_timed_mutex> read(fence);
- if (mdclog_level_get() >= MDCLOG_DEBUG) {
-
- }
+ std::shared_lock<std::shared_timed_mutex> read(fence);
auto entry = keyMap.find(key);
if (entry == keyMap.end()) {
return nullptr;
auto entry = keyMap.find(key);
if (entry == keyMap.end()) {
return nullptr;
@@
-46,32
+47,30
@@
public:
}
void setkey(char *key, void *val) {
}
void setkey(char *key, void *val) {
-
unique_lock<
shared_timed_mutex> write(fence);
+
std::unique_lock<std::
shared_timed_mutex> write(fence);
keyMap[key] = val;
}
void *erase(char *key) {
keyMap[key] = val;
}
void *erase(char *key) {
-
unique_lock<
shared_timed_mutex> write(fence);
+
std::unique_lock<std::
shared_timed_mutex> write(fence);
return (void *)keyMap.erase(key);
}
void clear() {
return (void *)keyMap.erase(key);
}
void clear() {
-
unique_lock<
shared_timed_mutex> write(fence);
+
std::unique_lock<std::
shared_timed_mutex> write(fence);
keyMap.clear();
}
keyMap.clear();
}
- void getKeys(vector<char *> &v) {
- s
hared_lock<
shared_timed_mutex> read(fence);
+ void getKeys(
std::
vector<char *> &v) {
+ s
td::shared_lock<std::
shared_timed_mutex> read(fence);
for (auto const &e : keyMap) {
v.emplace_back((char *)e.first.c_str());
}
}
for (auto const &e : keyMap) {
v.emplace_back((char *)e.first.c_str());
}
}
-
-
private:
private:
- std::unordered_map<string, void *> keyMap;
- shared_timed_mutex fence;
+ std::unordered_map<st
d::st
ring, void *> keyMap;
+ s
td::s
hared_timed_mutex fence;
};
#endif //E2_MAPWRAPPER_H
};
#endif //E2_MAPWRAPPER_H