Project
Loading...
Searching...
No Matches
DigitSinkImpl.cxx
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
12#include "DigitSinkImpl.h"
13#include "DigitIOV0.h"
14#include "DigitIOV1.h"
15#include "DigitIOV2.h"
16#include "DigitIOV3.h"
17#include "DigitIOV4.h"
18#include <fmt/format.h>
19
20namespace o2::mch::io::impl
21{
22std::unique_ptr<DigitSinkImpl> createDigitSinkImpl(int version)
23{
24 switch (version) {
25 case 0:
26 return std::make_unique<DigitSinkV0>();
27 case 1:
28 return std::make_unique<DigitSinkV1>();
29 case 2:
30 return std::make_unique<DigitSinkV2>();
31 case 3:
32 return std::make_unique<DigitSinkV3>();
33 case 4:
34 return std::make_unique<DigitSinkV4>();
35 default:
36 break;
37 };
38 throw std::invalid_argument(fmt::format("DigitFileFormat version {} not implemented yet",
39 version));
40 return nullptr;
41}
42
43} // namespace o2::mch::io::impl
uint32_t version
Definition RawData.h:8
std::unique_ptr< DigitSinkImpl > createDigitSinkImpl(int version)