Project
Loading...
Searching...
No Matches
GPUDisplayTypes.h
Go to the documentation of this file.
1// Copyright 2019-2026 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#ifndef GPUDISPLAYTYPES_H
16#define GPUDISPLAYTYPES_H
17
18#include "utils/vecpod.h"
19#include <atomic>
20#include <cstdint>
21#include <ostream>
22
23namespace o2::gpu
24{
25struct GPUDisplayMultiSliderValue { // Value of a Qt GUI multi slider (GUI_MULTI_SLIDER): positions in the order of the display, selected one (-1: none), end of the range, progress
27 int16_t selected = -1;
28 uint16_t progress = 0; // Fraction (of 65535) of the last position highlighted, e.g. a running animation; small types: GPUDisplayGUIValue must not grow
29 float max = 0.f;
30 bool operator==(const GPUDisplayMultiSliderValue&) const = default;
31 friend std::ostream& operator<<(std::ostream& out, const GPUDisplayMultiSliderValue& v) // For the qconfig printout
32 {
33 for (float x : v.values) {
34 out << x << " ";
35 }
36 return out << "(selected " << v.selected << ")";
37 }
38};
39
40template <class T>
41struct GPUDisplayCopyableAtomic : std::atomic<T> { // std::atomic deletes the copy, here it copies the value
42 using std::atomic<T>::atomic;
43 GPUDisplayCopyableAtomic(const GPUDisplayCopyableAtomic& o) : std::atomic<T>(o.load()) {}
45 {
46 this->store(o.load());
47 return *this;
48 }
49};
50} // namespace o2::gpu
51
52#endif
unsigned short int uint16_t
GLint GLenum GLint x
Definition glcorearb.h:403
const GLdouble * v
Definition glcorearb.h:832
GPUDisplayCopyableAtomic & operator=(const GPUDisplayCopyableAtomic &o)
GPUDisplayCopyableAtomic(const GPUDisplayCopyableAtomic &o)
bool operator==(const GPUDisplayMultiSliderValue &) const =default
friend std::ostream & operator<<(std::ostream &out, const GPUDisplayMultiSliderValue &v)
typename std::vector< T, vecpod_allocator< T > > vecpod
Definition vecpod.h:31