ATLAS Offline Software
Loading...
Searching...
No Matches
EventStream.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef JIVEXML_EVENTSTREAM_H
6#define JIVEXML_EVENTSTREAM_H
7
8#include <string>
9#include <map>
10
11namespace JiveXML {
12
20
21 public:
22
23 //Constructor with all parameters
24 EventStreamID( unsigned long EventNumber, unsigned int RunNumber, const std::string& StreamName ) :
26 };
27
28 //Constructor with all paramters and char *
29 EventStreamID( unsigned long EventNumber, unsigned int RunNumber, const char* StreamName ) :
31 //Check for NULL pointer
33 };
34
35 //Constructor with just a stream name - usefull for searching in the map
36 EventStreamID( const std::string& StreamName ) :
38 };
39
40 //Get the different values
41 unsigned long EventNumber() const { return m_event; };
42 unsigned int RunNumber() const { return m_run; };
43 const std::string& StreamName() const { return m_stream; };
44 const char* StreamNameCStr() const { return m_stream.c_str(); };
45
46 //Check wether two EventStreamIDs are refering to the same event
47 bool isSameEvent ( const EventStreamID& id ) const {
48 return (( id.StreamName() == m_stream ) &&
49 ( id.RunNumber() == m_run ) &&
50 ( id.EventNumber() == m_event ));
51 }
52
53 //Check wether the ID is valid, i.e. stream name, run and event number
54 //greater / greater-equal zero
55 bool isValid () const {
56 return (( !m_stream.empty() ) && ( m_run != 0 ) && ( m_event != 0 ));
57 }
58
59 //Define comparision operators for the map,
60 //i.e. only based on stream name, which is the key
61 inline bool operator == ( const EventStreamID& id ) const {
62 return ( id.StreamName() == m_stream );
63 }
64
65 inline bool operator < ( const EventStreamID& id ) const {
66 return ( id.StreamName() < m_stream );
67 }
68
69 private:
70
71 //the event number
72 unsigned int m_event;
73 //the run number
74 unsigned int m_run;
75 //the stream name
76 std::string m_stream;
77 };
78
86 typedef std::pair< const EventStreamID, const std::string> EventStreamPair;
87 typedef std::map< const EventStreamID, const std::string> EventStreamMap;
88
89} //namespace
90
91#endif
92
bool isSameEvent(const EventStreamID &id) const
Definition EventStream.h:47
EventStreamID(unsigned long EventNumber, unsigned int RunNumber, const std::string &StreamName)
Definition EventStream.h:24
unsigned int RunNumber() const
Definition EventStream.h:42
bool operator<(const EventStreamID &id) const
Definition EventStream.h:65
unsigned long EventNumber() const
Definition EventStream.h:41
const std::string & StreamName() const
Definition EventStream.h:43
EventStreamID(const std::string &StreamName)
Definition EventStream.h:36
bool operator==(const EventStreamID &id) const
Definition EventStream.h:61
const char * StreamNameCStr() const
Definition EventStream.h:44
EventStreamID(unsigned long EventNumber, unsigned int RunNumber, const char *StreamName)
Definition EventStream.h:29
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
std::pair< const EventStreamID, const std::string > EventStreamPair
A map that stores events according to their EventStreamID Due to the way EventStreamID is build,...
Definition EventStream.h:86
std::map< const EventStreamID, const std::string > EventStreamMap
Definition EventStream.h:87