Project
Loading...
Searching...
No Matches
ROBoardConfigHandler.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
16#ifndef O2_MID_ROBOARDCONFIGHANDLER_H
17#define O2_MID_ROBOARDCONFIGHANDLER_H
18
19#include <iostream>
20#include <vector>
21#include <unordered_map>
23
24namespace o2
25{
26namespace mid
27{
29{
30 public:
34 ROBoardConfigHandler(const char* filename);
36 ROBoardConfigHandler(std::istream& in);
38 ROBoardConfigHandler(const std::vector<ROBoardConfig>& configurations);
41
45 const ROBoardConfig getConfig(uint8_t uniqueLocId) const;
46
48 const std::unordered_map<uint8_t, ROBoardConfig> getConfigMap() const { return mROBoardConfigs; }
49
52 void set(const std::vector<ROBoardConfig>& configurations);
53
56 void updateMasks(const std::vector<ROBoard>& masks);
57
60 void write(const char* filename) const;
61
64 void write(std::ostream& out) const;
65
66 private:
72 bool load(const char* filename);
73
76 void load(std::istream& in);
77
78 std::unordered_map<uint8_t, ROBoardConfig> mROBoardConfigs;
79};
80
84std::vector<ROBoardConfig> makeDefaultROBoardConfig(uint16_t gbtUniqueId = 0xFFFF);
88std::vector<ROBoardConfig> makeNoZSROBoardConfig(uint16_t gbtUniqueId = 0xFFFF);
92std::vector<ROBoardConfig> makeZSROBoardConfig(uint16_t gbtUniqueId = 0xFFFF);
93} // namespace mid
94} // namespace o2
95
96#endif /* O2_MID_ROBOARDCONFIGHANDLER_H */
Configuration for the readout local board.
const ROBoardConfig getConfig(uint8_t uniqueLocId) const
void write(const char *filename) const
void updateMasks(const std::vector< ROBoard > &masks)
const std::unordered_map< uint8_t, ROBoardConfig > getConfigMap() const
Returns the configuration map.
void set(const std::vector< ROBoardConfig > &configurations)
ROBoardConfigHandler()
Default constructor.
~ROBoardConfigHandler()=default
Default destructor.
std::vector< ROBoardConfig > makeNoZSROBoardConfig(uint16_t gbtUniqueId=0xFFFF)
std::vector< ROBoardConfig > makeDefaultROBoardConfig(uint16_t gbtUniqueId=0xFFFF)
std::vector< ROBoardConfig > makeZSROBoardConfig(uint16_t gbtUniqueId=0xFFFF)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string filename()