scifir-units 2.0.0
scifir-units is a library of units of measurement, angles, coordinates, fields, and related data, all lightweight, that help in the development of scientific software and scientific machines
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
lab_number.hpp File Reference
#include "../util/is_number.hpp"
#include "../util/types.hpp"
#include "../units/scalar_unit.hpp"
#include "boost/algorithm/string.hpp"
#include <cmath>
#include <iostream>
#include <string>
Include dependency graph for lab_number.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  scifir::lab_number< T >
 

Namespaces

namespace  scifir
 The namespace scifir contains all scifir-units, excepting the string literals, which are outside.
 

Functions

template<typename T >
string scifir::to_string (const lab_number< T > &x)
 
bool scifir::is_lab_number (const string &init_lab_number)
 
template<typename T , typename U >
bool operator== (const scifir::lab_number< T > &x, const scifir::lab_number< U > &y)
 
template<typename T , typename U >
bool operator!= (const scifir::lab_number< T > &x, const scifir::lab_number< U > &y)
 
template<typename T >
bool operator== (const scifir::lab_number< T > &x, const string &init_lab_number)
 
template<typename T >
bool operator!= (const scifir::lab_number< T > &x, const string &init_lab_number)
 
template<typename T >
bool operator== (const string &init_lab_number, const scifir::lab_number< T > &x)
 
template<typename T >
bool operator!= (const string &init_lab_number, const scifir::lab_number< T > &x)
 
template<typename T >
void operator+= (string &x, const scifir::lab_number< T > &y)
 
template<typename T >
string operator+ (const string &x, const scifir::lab_number< T > &y)
 
template<typename T >
string operator+ (const scifir::lab_number< T > &x, const string &y)
 
template<typename T >
ostream & operator<< (ostream &os, const scifir::lab_number< T > &x)
 
template<typename T >
istream & operator>> (istream &is, scifir::lab_number< T > &x)
 

Function Documentation

◆ operator!=() [1/3]

template<typename T , typename U >
bool operator!= ( const scifir::lab_number< T > &  x,
const scifir::lab_number< U > &  y 
)

Definition at line 136 of file lab_number.hpp.

137{
138 return !(x == y);
139}

◆ operator!=() [2/3]

template<typename T >
bool operator!= ( const scifir::lab_number< T > &  x,
const string &  init_lab_number 
)

Definition at line 149 of file lab_number.hpp.

150{
151 return !(x == init_lab_number);
152}

◆ operator!=() [3/3]

template<typename T >
bool operator!= ( const string &  init_lab_number,
const scifir::lab_number< T > &  x 
)

Definition at line 162 of file lab_number.hpp.

163{
164 return !(init_lab_number == x);
165}

◆ operator+() [1/2]

template<typename T >
string operator+ ( const scifir::lab_number< T > &  x,
const string &  y 
)

Definition at line 180 of file lab_number.hpp.

181{
182 return to_string(x) + y;
183}
string to_string(const aid &x)
Creates a string representation of aid, it's for aid equivalent to the display() function of aid.
Definition aid.cpp:582

◆ operator+() [2/2]

template<typename T >
string operator+ ( const string &  x,
const scifir::lab_number< T > &  y 
)

Definition at line 174 of file lab_number.hpp.

175{
176 return x + to_string(y);
177}

◆ operator+=()

template<typename T >
void operator+= ( string &  x,
const scifir::lab_number< T > &  y 
)

Definition at line 168 of file lab_number.hpp.

169{
170 x += to_string(y);
171}

◆ operator<<()

template<typename T >
ostream & operator<< ( ostream &  os,
const scifir::lab_number< T > &  x 
)

Definition at line 186 of file lab_number.hpp.

187{
188 return os << to_string(x);
189}

◆ operator==() [1/3]

template<typename T , typename U >
bool operator== ( const scifir::lab_number< T > &  x,
const scifir::lab_number< U > &  y 
)

Definition at line 123 of file lab_number.hpp.

124{
125 if (x.value == y.value and x.error_value == y.error_value)
126 {
127 return true;
128 }
129 else
130 {
131 return false;
132 }
133}

◆ operator==() [2/3]

template<typename T >
bool operator== ( const scifir::lab_number< T > &  x,
const string &  init_lab_number 
)

Definition at line 142 of file lab_number.hpp.

143{
144 scifir::lab_number<T> y(init_lab_number);
145 return (x == y);
146}

◆ operator==() [3/3]

template<typename T >
bool operator== ( const string &  init_lab_number,
const scifir::lab_number< T > &  x 
)

Definition at line 155 of file lab_number.hpp.

156{
157 scifir::lab_number<T> y(init_lab_number);
158 return (x == y);
159}

◆ operator>>()

template<typename T >
istream & operator>> ( istream &  is,
scifir::lab_number< T > &  x 
)

Definition at line 192 of file lab_number.hpp.

193{
194 char a[256];
195 is.getline(a, 256);
196 string b(a);
198 return is;
199}