ATLAS Offline Software
Loading...
Searching...
No Matches
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 $
14
15
16#ifndef CXXUTILS_ARRAYSCANNER_H
17#define CXXUTILS_ARRAYSCANNER_H
18
19
20#include <istream>
21
22
23namespace CxxUtils {
24
25
40{
41public:
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
96private:
106 bool at_char (char c);
107
116 bool at_num_common();
117
118
120 std::istream& m_is;
121};
122
123
124template <class T>
126{
127 m_is >> elt;
128 return at_num_common();
129}
130
131
132} // namespace CxxUtils
133
134
135// Backwards compatibility.
136namespace CaloRec {
138}
139
140
141#endif // not CXXUTILS_ARRAYSCANNER_H
ArrayScanner(std::istream &is)
Constructor.
Helper class for converting strings to Array's.
bool at_char(char c)
Read a character.
bool at_close()
Read closing token.
bool at_num_common()
The non-template part of reading a number.
bool at_open()
Read opening token.
bool at_num(T &elt)
Read number.
std::istream & m_is
The stream from which we're reading.
ArrayScanner(std::istream &is)
Constructor.
bool at_end()
Test for end-of-stream.
Namespace for helper functions.