Project
Loading...
Searching...
No Matches
GPUDisplayLoader.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
14
15#include "GPUDisplay.h"
17#include "GPUDisplayInterface.h"
18
19#include <tuple>
20#include <stdexcept>
21
22using namespace o2::gpu;
23
24extern "C" void* GPUTrackingDisplayLoader(const char*, void*);
25
26template <class T, typename... Args>
27static inline T* createHelper(Args... args)
28{
29 return new T(args...);
30}
31
32void* GPUTrackingDisplayLoader(const char* type, void* args)
33{
34 if (strcmp(type, "display") == 0) {
35 auto x = (std::tuple<GPUDisplayFrontend*, GPUChainTracking*, GPUQA*, const GPUParam*, const GPUCalibObjectsConst*, const GPUSettingsDisplay*>*)args;
36 return std::apply([](auto&&... y) { return createHelper<GPUDisplay>(y...); }, *x);
37 } else if (strcmp(type, "frontend") == 0) {
38 auto x = (std::tuple<const char*>*)args;
39 return std::apply([](auto&&... y) { return GPUDisplayFrontend::getFrontend(y...); }, *x);
40 } else {
41 throw std::runtime_error("Invalid display obejct type specified");
42 }
43 return nullptr;
44}
void * GPUTrackingDisplayLoader(const char *, void *)
static GPUDisplayFrontend * getFrontend(const char *type)
GLint GLenum GLint x
Definition glcorearb.h:403
GLint GLint GLsizei GLint GLenum GLenum type
Definition glcorearb.h:275