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
18namespace o2::framework
19{
20
24 struct Id {
25 int64_t value;
27 {
28 return {reinterpret_cast<int64_t>(ref.payload)};
29 }
30 bool operator==(const Id& other) const
31 {
32 return value == other.value;
33 }
34
35 struct hash_fn {
36 std::size_t operator()(const Id& id) const
37 {
38 return id.value;
39 }
40 };
41 };
46 std::unordered_map<std::string, Id> matcherToId;
49 std::unordered_map<Id, void*, Id::hash_fn> idToObject;
50
54 std::unordered_map<std::string, Id> matcherToMetadataId;
55 std::unordered_map<Id, std::map<std::string, std::string>, Id::hash_fn> idToMetadata;
56};
57
58} // namespace o2::framework
59
60#endif // O2_FRAMEWORK_OBJECTCACHE_H_
GLsizei const GLfloat * value
Definition glcorearb.h:819
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::size_t operator()(const Id &id) const
Definition ObjectCache.h:36
static Id fromRef(DataRef &ref)
Definition ObjectCache.h:26
bool operator==(const Id &other) const
Definition ObjectCache.h:30
std::unordered_map< Id, std::map< std::string, std::string >, Id::hash_fn > idToMetadata
Definition ObjectCache.h:55
std::unordered_map< Id, void *, Id::hash_fn > idToObject
Definition ObjectCache.h:49
std::unordered_map< std::string, Id > matcherToId
Definition ObjectCache.h:46
std::unordered_map< std::string, Id > matcherToMetadataId
Definition ObjectCache.h:54
VectorOfTObjectPtrs other