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
21#include <string>
22#include <map>
23
24namespace o2
25{
26namespace event_visualisation
27{
28
30{
31 static std::map<std::string, VisualisationEventSerializer*> instances;
32
33 protected:
35 static std::string fileNameIndexed(const std::string fileName, const int index);
36 static o2::dataformats::GlobalTrackID deserialize(unsigned seralizedValue);
37
38 static unsigned serialize(o2::dataformats::GlobalTrackID gidValue);
39
40 static time_t parseDateTime(const char* datetimeString);
41 static std::string DateTime(time_t time);
42 static std::string bits(unsigned number);
43
44 public:
45 static o2::dataformats::GlobalTrackID gidFromString(const std::string& gid);
46 static o2::dataformats::GlobalTrackID deserialize(unsigned source, unsigned index, unsigned flags);
47 static VisualisationEventSerializer* getInstance(std::string ext) { return instances[ext]; }
48 virtual bool fromFile(VisualisationEvent& event, std::string fileName) = 0;
49 virtual void toFile(const VisualisationEvent& event, Location& location) = 0;
50 virtual const std::string serializerName() const = 0;
51 virtual ~VisualisationEventSerializer() = default;
52};
53
54} // namespace event_visualisation
55} // namespace o2
56
57#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
virtual void toFile(const VisualisationEvent &event, Location &location)=0
static o2::dataformats::GlobalTrackID deserialize(unsigned seralizedValue)
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 ...