ATLAS Offline Software
DataType.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef JIVEXML_DATATYPE_H
6 #define JIVEXML_DATATYPE_H
7 
8 #include <string>
9 #include <sstream>
10 #include <map>
11 #include <vector>
12 
13 namespace JiveXML{
14 
21  class DataType {
22 
23  private:
24  std::string m_thing;
25 
26  public:
27 
32  template < class T > DataType(T t){
34  std::ostringstream ost;
36  ost << t;
38  m_thing = ost.str() ;
40  if ((m_thing=="inf")||
41  (m_thing=="nan")){
42  m_thing = "0";
43  }
44  }
45 
47  DataType();
48 
50  std::string toString() const ;
51  };
52 
54  std::ostream& operator<<( std::ostream& os, const DataType &dt );
55 
58  typedef std::vector<DataType> DataVect ;
59  typedef std::map<std::string, DataVect > DataMap ;
60 
62  typedef std::pair<std::string,std::string> TagType;
63 
64 } //namespace
65 
66 #endif
python.trigbs_prescaleL1.ost
ost
Definition: trigbs_prescaleL1.py:104
JiveXML::DataVect
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
Definition: DataType.h:58
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition: RoIBResultByteStreamTool.cxx:25
JiveXML::DataType::toString
std::string toString() const
Return the string.
Definition: DataType.cxx:18
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
JiveXML::DataMap
std::map< std::string, DataVect > DataMap
Definition: DataType.h:59
JiveXML::DataType::m_thing
std::string m_thing
Definition: DataType.h:24
JiveXML::DataType::DataType
DataType(T t)
Templated constructor – this is resolved at compile time so the constructor must be implemented in th...
Definition: DataType.h:32
JiveXML::DataType
Templated class to convert any object that is streamable in a ostringstream in a string.
Definition: DataType.h:21
CaloNoise_fillDB.dt
dt
Definition: CaloNoise_fillDB.py:58
JiveXML::operator<<
std::ostream & operator<<(std::ostream &os, const DataType &dt)
Allow this to be streamed in an ostream.
Definition: DataType.cxx:27
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
JiveXML
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
Definition: BadLArRetriever.cxx:21
JiveXML::DataType::DataType
DataType()
Empty constructor.
Definition: DataType.cxx:12
JiveXML::TagType
std::pair< std::string, std::string > TagType
Defines a tag as a pair of strings.
Definition: DataType.h:62