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
size_nd.hpp File Reference
#include "../derived_units/space_units.hpp"
#include "../util/types.hpp"
#include "boost/algorithm/string.hpp"
#include <string>
#include <vector>
Include dependency graph for size_nd.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  scifir::size_nd< T >
 
class  scifir::size_nd< float >
 

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 size_nd< T > &x)
 
string scifir::to_string (const size_nd< float > &x)
 
template<typename T >
bool operator== (const scifir::size_nd< T > &x, const scifir::size_nd< T > &y)
 
template<typename T >
bool operator!= (const scifir::size_nd< T > &x, const scifir::size_nd< T > &y)
 
template<typename T >
bool operator== (const scifir::size_nd< T > &x, const string &init_size_nd)
 
template<typename T >
bool operator!= (const scifir::size_nd< T > &x, const string &init_size_nd)
 
template<typename T >
bool operator== (const string &init_size_nd, const scifir::size_nd< T > &x)
 
template<typename T >
bool operator!= (const string &init_size_nd, const scifir::size_nd< T > &x)
 
template<typename T >
void operator+= (string &x, const scifir::size_nd< T > &y)
 
template<typename T >
string operator+ (const string &x, const scifir::size_nd< T > &y)
 
template<typename T >
string operator+ (const scifir::size_nd< T > &x, const string &y)
 
template<typename T >
ostream & operator<< (ostream &os, const scifir::size_nd< T > &x)
 
template<typename T >
istream & operator>> (istream &is, scifir::size_nd< T > &x)
 

Function Documentation

◆ operator!=() [1/3]

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

Definition at line 379 of file size_nd.hpp.

380{
381 return !(x == y);
382}

◆ operator!=() [2/3]

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

Definition at line 392 of file size_nd.hpp.

393{
394 return !(x == init_size_nd);
395}

◆ operator!=() [3/3]

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

Definition at line 405 of file size_nd.hpp.

406{
407 return !(init_size_nd == x);
408}

◆ operator+() [1/2]

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

Definition at line 423 of file size_nd.hpp.

424{
425 return to_string(x) + y;
426}
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::size_nd< T > &  y 
)

Definition at line 417 of file size_nd.hpp.

418{
419 return x + to_string(y);
420}

◆ operator+=()

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

Definition at line 411 of file size_nd.hpp.

412{
413 x += to_string(y);
414}

◆ operator<<()

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

Definition at line 429 of file size_nd.hpp.

430{
431 return os << to_string(x);
432}

◆ operator==() [1/3]

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

Definition at line 359 of file size_nd.hpp.

360{
361 if (x.get_nd() == y.get_nd())
362 {
363 for (int i = 0; i < x.widths.size(); i++)
364 {
365 if (x.widths[i] != y.widths[i])
366 {
367 return false;
368 }
369 }
370 return true;
371 }
372 else
373 {
374 return false;
375 }
376}

◆ operator==() [2/3]

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

Definition at line 385 of file size_nd.hpp.

386{
387 scifir::size_nd<T> y(init_size_nd);
388 return (x == y);
389}

◆ operator==() [3/3]

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

Definition at line 398 of file size_nd.hpp.

399{
400 scifir::size_nd<T> y(init_size_nd);
401 return (x == y);
402}

◆ operator>>()

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

Definition at line 435 of file size_nd.hpp.

436{
437 char a[256];
438 is.getline(a, 256);
439 string b(a);
440 x = scifir::size_nd<T>(b);
441 return is;
442}