Cppcheck
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
MathLib::value Class Reference

value class More...

#include <mathlib.h>

Public Member Functions

 value (const std::string &s)
 
std::string str () const
 
bool isInt () const
 
bool isFloat () const
 
double getDoubleValue () const
 
int compare (const value &v) const
 
value add (int v) const
 
value shiftLeft (const value &v) const
 
value shiftRight (const value &v) const
 

Static Public Member Functions

static value calc (char op, const value &v1, const value &v2)
 

Private Types

enum class  Type { INT , LONG , LONGLONG , FLOAT }
 

Private Member Functions

void promote (const value &v)
 

Private Attributes

long long mIntValue {}
 
double mDoubleValue {}
 
enum MathLib::value::Type mType
 
bool mIsUnsigned {}
 

Detailed Description

value class

Definition at line 38 of file mathlib.h.

Member Enumeration Documentation

◆ Type

enum MathLib::value::Type
strongprivate
Enumerator
INT 
LONG 
LONGLONG 
FLOAT 

Definition at line 42 of file mathlib.h.

Constructor & Destructor Documentation

◆ value()

MathLib::value::value ( const std::string &  s)
explicit

Member Function Documentation

◆ add()

MathLib::value MathLib::value::add ( int  v) const

Definition at line 254 of file mathlib.cpp.

References isInt(), mDoubleValue, and mIntValue.

◆ calc()

MathLib::value MathLib::value::calc ( char  op,
const value v1,
const value v2 
)
static

◆ compare()

int MathLib::value::compare ( const value v) const

Definition at line 226 of file mathlib.cpp.

References getDoubleValue(), isFloat(), mDoubleValue, mIntValue, mIsUnsigned, and promote().

◆ getDoubleValue()

double MathLib::value::getDoubleValue ( ) const
inline

Definition at line 57 of file mathlib.h.

Referenced by calc(), and compare().

◆ isFloat()

bool MathLib::value::isFloat ( ) const
inline

Definition at line 53 of file mathlib.h.

Referenced by calc(), compare(), and TemplateSimplifier::getTemplateInstantiations().

◆ isInt()

bool MathLib::value::isInt ( ) const
inline

◆ promote()

void MathLib::value::promote ( const value v)
private

Definition at line 108 of file mathlib.cpp.

References FLOAT, MathLib::isFloat(), isInt(), MathLib::isInt(), mIsUnsigned, and mType.

Referenced by calc(), and compare().

◆ shiftLeft()

MathLib::value MathLib::value::shiftLeft ( const value v) const

Definition at line 264 of file mathlib.cpp.

References MathLib::bigint_bits, isInt(), MathLib::isInt(), and mIntValue.

Referenced by operator<<().

◆ shiftRight()

MathLib::value MathLib::value::shiftRight ( const value v) const

Definition at line 276 of file mathlib.cpp.

References MathLib::bigint_bits, isInt(), MathLib::isInt(), and mIntValue.

Referenced by operator>>().

◆ str()

std::string MathLib::value::str ( ) const

Definition at line 74 of file mathlib.cpp.

References FLOAT, LONG, and LONGLONG.

Referenced by MathLib::toString().

Member Data Documentation

◆ mDoubleValue

double MathLib::value::mDoubleValue {}
private

Definition at line 41 of file mathlib.h.

Referenced by add(), calc(), compare(), and value().

◆ mIntValue

long long MathLib::value::mIntValue {}
private

Definition at line 40 of file mathlib.h.

Referenced by add(), calc(), compare(), shiftLeft(), shiftRight(), and value().

◆ mIsUnsigned

bool MathLib::value::mIsUnsigned {}
private

Definition at line 43 of file mathlib.h.

Referenced by calc(), compare(), promote(), and value().

◆ mType

enum MathLib::value::Type MathLib::value::mType
private

Referenced by promote(), and value().


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