ANNA Suite  2020b
Multipurpose development suite for Telco applications
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
anna::Millisecond Class Reference

#include <Millisecond.hpp>

Public Types

typedef S64 type_t
 

Public Member Functions

 Millisecond ()
 
 Millisecond (const type_t value)
 
 Millisecond (const Millisecond &other)
 
 Millisecond (const Second &other)
 
 Millisecond (const Microsecond &other)
 
 operator type_t () const
 
type_trefValue ()
 
Millisecondoperator= (const type_t other)
 
Millisecondoperator= (const Millisecond &other)
 
Millisecondoperator= (const Second &other)
 
Millisecondoperator= (const Microsecond &other)
 
bool operator== (const Millisecond &other) const
 
bool operator== (const Second &other) const
 
bool operator== (const Microsecond &other) const
 
bool operator!= (const Millisecond &other) const
 
bool operator!= (const Second &other) const
 
bool operator!= (const Microsecond &other) const
 
bool operator> (const Millisecond &other) const
 
bool operator> (const Second &other) const
 
bool operator> (const Microsecond &other) const
 
bool operator< (const Millisecond &other) const
 
bool operator< (const Second &other) const
 
bool operator< (const Microsecond &other) const
 
bool operator>= (const Millisecond &other) const
 
bool operator>= (const Second &other) const
 
bool operator>= (const Microsecond &other) const
 
bool operator<= (const Millisecond &other) const
 
bool operator<= (const Second &other) const
 
bool operator<= (const Microsecond &other) const
 
Millisecondoperator+= (const Millisecond &other)
 
Millisecondoperator-= (const Millisecond &other)
 
type_t getValue () const
 
timeval * getTimeVal (timeval &tv) const
 
std::string asString () const
 

Static Public Member Functions

static Millisecond getTime ()
 
static Millisecond fromString (const std::string &value) noexcept(false)
 

Friends

class Second
 
class Microsecond
 
class Millisecond operator/ (const Millisecond &left, const Millisecond &right)
 
class Millisecond operator+ (const Millisecond &left, const Millisecond &right)
 
class Millisecond operator- (const Millisecond &left, const Millisecond &right)
 
class Millisecond operator/ (const Millisecond &left, const int right)
 
class Millisecond operator/ (const Millisecond &left, const unsigned int right)
 
class Millisecond operator* (const Millisecond &left, const int right)
 

Member Typedef Documentation

◆ type_t

Constructor & Destructor Documentation

◆ Millisecond() [1/5]

anna::Millisecond::Millisecond ( )
inline

Constructor

31 : a_value(0) {;}

◆ Millisecond() [2/5]

anna::Millisecond::Millisecond ( const type_t  value)
inlineexplicit

Constructor.

Parameters
valueValor inicial de esta instancia.
37 : a_value(value) {;}

◆ Millisecond() [3/5]

anna::Millisecond::Millisecond ( const Millisecond other)
inline

Constructor copia.

Parameters
otherInstancia de la que copiar.
43 : a_value(other.a_value) {;}
Here is the call graph for this function:

◆ Millisecond() [4/5]

anna::Millisecond::Millisecond ( const Second other)

Constructor copia.

Parameters
otherInstancia de la que copiar.

◆ Millisecond() [5/5]

anna::Millisecond::Millisecond ( const Microsecond other)

Constructor copia.

Parameters
otherInstancia de la que copiar.

Member Function Documentation

◆ asString()

std::string anna::Millisecond::asString ( ) const

Devuelve una cadena con el valor de esta instancia y las unidades "ms".

Returns
una cadena con el valor de esta instancia y las unidades "ms".

◆ fromString()

static Millisecond anna::Millisecond::fromString ( const std::string &  value)
staticnoexcept

Obtiene los microsegundos del valor contenido en la cadena recibida como parámetro.

Parameters
valueCadena que contiene los microsegundos habrá sido obtenida con asString.
Returns
los microsegundos del valor contenido en la cadena recibida como parámetro.

◆ getTime()

static Millisecond anna::Millisecond::getTime ( )
static

Devuelve la hora actual de sistema expresada en milisegundos transcurridos desde el 1 de Enero de 1970

Returns
la hora actual de sistema expresada en milisegundos transcurridos desde el 1 de Enero de 1970

◆ getTimeVal()

timeval* anna::Millisecond::getTimeVal ( timeval &  tv) const

Si el valor de esta instancia es positivo devuelve el valor asociado a esta instancia en una estructura de time timeval usada habitualmente para temporizar operaciones a nivel de SO, en otro caso retorna NULL.

Parameters
tvInstancia sobre la que guardar el valor en caso de que se éste tenga un valor positivo.
Returns
Si el valor de esta instancia es positivo devuelve el valor asociado a esta instancia en una estructura de time timeval usada habitualmente para temporizar operaciones a nivel de SO, en otro caso retorna NULL.

◆ getValue()

type_t anna::Millisecond::getValue ( ) const
inline

Devuelve el valor asociado a esta instancia.

Returns
el valor asociado a esta instancia.
120 { return a_value; }
Here is the call graph for this function:

◆ operator type_t()

anna::Millisecond::operator type_t ( ) const
inline

Conversor a numérico.

Returns
El valor asociado a esta instancia.
61 { return a_value; }

◆ operator!=() [1/3]

bool anna::Millisecond::operator!= ( const Millisecond other) const
inline
82 { return a_value != other.a_value; }

◆ operator!=() [2/3]

bool anna::Millisecond::operator!= ( const Second other) const

◆ operator!=() [3/3]

bool anna::Millisecond::operator!= ( const Microsecond other) const

◆ operator+=()

Millisecond& anna::Millisecond::operator+= ( const Millisecond other)
inline
112 { a_value += other.a_value; return *this; }

◆ operator-=()

Millisecond& anna::Millisecond::operator-= ( const Millisecond other)
inline
114 {(a_value > other.a_value) ? (a_value -= other.a_value) : (a_value = 0); return *this; }

◆ operator<() [1/3]

bool anna::Millisecond::operator< ( const Millisecond other) const
inline
94 { return a_value < other.a_value; }

◆ operator<() [2/3]

bool anna::Millisecond::operator< ( const Second other) const

◆ operator<() [3/3]

bool anna::Millisecond::operator< ( const Microsecond other) const

◆ operator<=() [1/3]

bool anna::Millisecond::operator<= ( const Millisecond other) const
inline
106 { return a_value <= other.a_value; }

◆ operator<=() [2/3]

bool anna::Millisecond::operator<= ( const Second other) const
inline
108 { return (operator==(other) == true) ? true : operator<(other); }
bool operator<(const Millisecond &other) const
Definition: Millisecond.hpp:94
Here is the call graph for this function:

◆ operator<=() [3/3]

bool anna::Millisecond::operator<= ( const Microsecond other) const
inline
110 { return (operator==(other) == true) ? true : operator<(other); }
bool operator<(const Millisecond &other) const
Definition: Millisecond.hpp:94
Here is the call graph for this function:

◆ operator=() [1/4]

Millisecond& anna::Millisecond::operator= ( const type_t  other)
inline
68 { a_value = other; return *this; }

◆ operator=() [2/4]

Millisecond& anna::Millisecond::operator= ( const Millisecond other)
inline
70 { a_value = other.a_value; return *this; }
Here is the call graph for this function:

◆ operator=() [3/4]

Millisecond& anna::Millisecond::operator= ( const Second other)

◆ operator=() [4/4]

Millisecond& anna::Millisecond::operator= ( const Microsecond other)

◆ operator==() [1/3]

bool anna::Millisecond::operator== ( const Millisecond other) const
inline
76 { return a_value == other.a_value; }

◆ operator==() [2/3]

bool anna::Millisecond::operator== ( const Second other) const

◆ operator==() [3/3]

bool anna::Millisecond::operator== ( const Microsecond other) const

◆ operator>() [1/3]

bool anna::Millisecond::operator> ( const Millisecond other) const
inline
88 { return a_value > other.a_value; }

◆ operator>() [2/3]

bool anna::Millisecond::operator> ( const Second other) const

◆ operator>() [3/3]

bool anna::Millisecond::operator> ( const Microsecond other) const

◆ operator>=() [1/3]

bool anna::Millisecond::operator>= ( const Millisecond other) const
inline
100 { return a_value >= other.a_value; }

◆ operator>=() [2/3]

bool anna::Millisecond::operator>= ( const Second other) const
inline
102 { return (operator==(other) == true) ? true : operator>(other); }
bool operator>(const Millisecond &other) const
Definition: Millisecond.hpp:88
Here is the call graph for this function:

◆ operator>=() [3/3]

bool anna::Millisecond::operator>= ( const Microsecond other) const
inline
104 { return (operator==(other) == true) ? true : operator>(other); }
bool operator>(const Millisecond &other) const
Definition: Millisecond.hpp:88
Here is the call graph for this function:

◆ refValue()

type_t& anna::Millisecond::refValue ( )
inline
66 { return a_value; }

Friends And Related Function Documentation

◆ Microsecond

friend class Microsecond
friend

◆ operator*

class Millisecond operator* ( const Millisecond left,
const int  right 
)
friend
190 {
191  return Millisecond(left.a_value * right);
192 }
Millisecond()
Definition: Millisecond.hpp:31

◆ operator+

class Millisecond operator+ ( const Millisecond left,
const Millisecond right 
)
friend
170 {
171  return Millisecond(left.a_value + right.a_value);
172 }
Millisecond()
Definition: Millisecond.hpp:31

◆ operator-

class Millisecond operator- ( const Millisecond left,
const Millisecond right 
)
friend
175 {
176  return Millisecond(left.a_value - right.a_value);
177 }
Millisecond()
Definition: Millisecond.hpp:31

◆ operator/ [1/3]

class Millisecond operator/ ( const Millisecond left,
const Millisecond right 
)
friend
165 {
166  return Millisecond(left.a_value / right.a_value);
167 }
Millisecond()
Definition: Millisecond.hpp:31

◆ operator/ [2/3]

class Millisecond operator/ ( const Millisecond left,
const int  right 
)
friend
180 {
181  return Millisecond(left.a_value / right);
182 }
Millisecond()
Definition: Millisecond.hpp:31

◆ operator/ [3/3]

class Millisecond operator/ ( const Millisecond left,
const unsigned int  right 
)
friend
185 {
186  return Millisecond(left.a_value / right);
187 }
Millisecond()
Definition: Millisecond.hpp:31

◆ Second

friend class Second
friend

The documentation for this class was generated from the following file: