PSCF v1.1
Lng.h
1#ifndef UTIL_LNG_H
2#define UTIL_LNG_H
3
4/*
5* Util Package - C++ Utilities for Scientific Computation
6*
7* Copyright 2010 - 2017, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include <iostream>
12
13namespace Util
14{
15
35 class Lng
36 {
37
38 public:
39
41
42
46 Lng();
47
53 explicit Lng(long int value);
54
61 Lng(long int value, int width);
62
64
66
72 void setValue(long int value);
73
79 void setWidth(int width);
80
82
84
88 long int value();
89
93 int width();
94
96
97 private:
98
100 long int value_;
101
103 int width_;
104
105 //friends:
106
107 friend std::istream& operator>>(std::istream& in, Lng &object);
108 friend std::ostream& operator<<(std::ostream& out, const Lng &object);
109
110 };
111
119 std::istream& operator>>(std::istream& in, Lng &object);
120
128 std::ostream& operator<<(std::ostream& out, const Lng &object);
129
130}
131#endif
Wrapper for a long int, for formatted ostream output.
Definition: Lng.h:36
void setWidth(int width)
Set field width.
Definition: Lng.cpp:37
void setValue(long int value)
Set value of long int.
Definition: Lng.cpp:34
friend std::ostream & operator<<(std::ostream &out, const Lng &object)
Output stream inserter for an Lng object.
Definition: Lng.cpp:66
friend std::istream & operator>>(std::istream &in, Lng &object)
Input stream extractor for an Lng object.
Definition: Lng.cpp:53
Lng()
Default constructor.
Definition: Lng.cpp:15
int width()
Get field width.
Definition: Lng.cpp:43
long int value()
Get value of long int.
Definition: Lng.cpp:40
Utility classes for scientific computation.
Definition: accumulators.mod:1
std::istream & operator>>(std::istream &in, Pair< Data > &pair)
Input a Pair from an istream.
Definition: Pair.h:44
std::ostream & operator<<(std::ostream &out, const Pair< Data > &pair)
Output a Pair to an ostream, without line breaks.
Definition: Pair.h:57