Project
Loading...
Searching...
No Matches
ObjectCache.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11#ifndef O2_FRAMEWORK_OBJECTCACHE_H_
12#define O2_FRAMEWORK_OBJECTCACHE_H_
13
14#include "Framework/DataRef.h"
15#include <unordered_map>
16#include <map>
17#include <string>
18
19namespace o2::framework
20{
21
26 struct Id {
29 {
30 return {reinterpret_cast<int64_t>(ref.payload)};
31 }
32 bool operator==(const Id& other) const
33 {
34 return value == other.value;
35 }
36
37 struct hash_fn {
38 std::size_t operator()(const Id& id) const
39 {
40 return id.value;
41 }
42 };
43 };
44
46 struct Entry {
47 Id id{0};
48 void* obj{nullptr};
49 };
50
53 Id id{0};
54 std::map<std::string, std::string> metadata;
55 };
56
60 std::unordered_map<std::string, Entry> matcherToEntry;
61
65 std::unordered_map<std::string, MetadataEntry> matcherToMetadata;
66};
67
68} // namespace o2::framework
69
70#endif // O2_FRAMEWORK_OBJECTCACHE_H_
GLsizei const GLfloat * value
Definition glcorearb.h:819
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
Per-path cache entry for a deserialised CCDB object.
Definition ObjectCache.h:46
std::size_t operator()(const Id &id) const
Definition ObjectCache.h:38
static Id fromRef(DataRef &ref)
Definition ObjectCache.h:28
bool operator==(const Id &other) const
Definition ObjectCache.h:32
Per-path cache entry for the CCDB metadata map.
Definition ObjectCache.h:52
std::map< std::string, std::string > metadata
Definition ObjectCache.h:54
std::unordered_map< std::string, Entry > matcherToEntry
Definition ObjectCache.h:60
std::unordered_map< std::string, MetadataEntry > matcherToMetadata
Definition ObjectCache.h:65
VectorOfTObjectPtrs other