Project
Loading...
Searching...
No Matches
VisualisationEventSerializer.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 O2EVE_VISUALISATIONEVENTSERIALIZER_H
17#define O2EVE_VISUALISATIONEVENTSERIALIZER_H
18
20#include <string>
21#include <map>
22
23namespace o2
24{
25namespace event_visualisation
26{
27
29{
30 static std::map<std::string, VisualisationEventSerializer*> instances;
31
32 protected:
34 static std::string fileNameIndexed(const std::string fileName, const int index);
35 static o2::dataformats::GlobalTrackID deserialize(unsigned seralizedValue);
36
37 static unsigned serialize(o2::dataformats::GlobalTrackID gidValue);
38
39 static time_t parseDateTime(const char* datetimeString);
40 static std::string DateTime(time_t time);
41 static std::string bits(unsigned number);
42
43 public:
44 static o2::dataformats::GlobalTrackID gidFromString(const std::string& gid);
45 static o2::dataformats::GlobalTrackID deserialize(unsigned source, unsigned index, unsigned flags);
46 static VisualisationEventSerializer* getInstance(std::string ext) { return instances[ext]; }
47 virtual bool fromFile(VisualisationEvent& event, std::string fileName) = 0;
48 virtual void toFile(const VisualisationEvent& event, std::string fileName) = 0;
49 virtual const std::string serializerName() const = 0;
50 virtual ~VisualisationEventSerializer() = default;
51};
52
53} // namespace event_visualisation
54} // namespace o2
55
56#endif // O2EVE_VISUALISATIONEVENTSERIALIZER_H
int16_t time
Definition RawEventData.h:4
virtual const std::string serializerName() const =0
static std::string fileNameIndexed(const std::string fileName, const int index)
static unsigned serialize(o2::dataformats::GlobalTrackID gidValue)
static VisualisationEventSerializer * getInstance(std::string ext)
virtual bool fromFile(VisualisationEvent &event, std::string fileName)=0
static o2::dataformats::GlobalTrackID deserialize(unsigned seralizedValue)
virtual void toFile(const VisualisationEvent &event, std::string fileName)=0
static o2::dataformats::GlobalTrackID gidFromString(const std::string &gid)
static o2::dataformats::GlobalTrackID deserialize(unsigned source, unsigned index, unsigned flags)
struct _cl_event * event
Definition glcorearb.h:2982
GLuint index
Definition glcorearb.h:781
GLsizei GLsizei GLchar * source
Definition glcorearb.h:798
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const void * bits
Definition glcorearb.h:4150
GLbitfield flags
Definition glcorearb.h:1570
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...