ATLAS Offline Software
ArrayScanner.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id: ArrayScanner.h,v 1.1 2009-03-20 20:44:22 ssnyder Exp $
16 #ifndef CXXUTILS_ARRAYSCANNER_H
17 #define CXXUTILS_ARRAYSCANNER_H
18 
19 
20 #include <istream>
21 
22 
23 namespace CxxUtils {
24 
25 
40 {
41 public:
48  ArrayScanner (std::istream& is);
49 
58  bool at_open();
59 
69  bool at_close();
70 
79  bool at_end();
80 
92  template <class T>
93  bool at_num (T& elt);
94 
95 
96 private:
106  bool at_char (char c);
107 
116  bool at_num_common();
117 
118 
120  std::istream& m_is;
121 };
122 
123 
124 template <class T>
125 bool ArrayScanner::at_num (T& elt)
126 {
127  m_is >> elt;
128  return at_num_common();
129 }
130 
131 
132 } // namespace CxxUtils
133 
134 
135 // Backwards compatibility.
136 namespace CaloRec {
138 }
139 
140 
141 #endif // not CXXUTILS_ARRAYSCANNER_H
CxxUtils::ArrayScanner::at_num
bool at_num(T &elt)
Read number.
Definition: ArrayScanner.h:125
CxxUtils::ArrayScanner::at_open
bool at_open()
Read opening token.
Definition: ArrayScanner.cxx:40
CxxUtils::ArrayScanner::ArrayScanner
ArrayScanner(std::istream &is)
Constructor.
Definition: ArrayScanner.cxx:26
CxxUtils::ArrayScanner::at_num_common
bool at_num_common()
The non-template part of reading a number.
Definition: ArrayScanner.cxx:116
CxxUtils::ArrayScanner
Helper class for converting strings to Array's.
Definition: ArrayScanner.h:40
CxxUtils::ArrayScanner::at_char
bool at_char(char c)
Read a character.
Definition: ArrayScanner.cxx:97
CxxUtils::ArrayScanner::at_end
bool at_end()
Test for end-of-stream.
Definition: ArrayScanner.cxx:81
CxxUtils
Definition: aligned_vector.h:29
CaloRec
Namespace for helper functions.
Definition: CaloCellFactor.h:22
CxxUtils::ArrayScanner::m_is
std::istream & m_is
The stream from which we're reading.
Definition: ArrayScanner.h:120
CxxUtils::ArrayScanner::at_close
bool at_close()
Read closing token.
Definition: ArrayScanner.cxx:59
python.compressB64.c
def c
Definition: compressB64.py:93