NebulaStream  0.6.213
NebulaStream is a data and application management framework for the internet of things
NES::Float Class Referencefinal

Float precision are inexact, variable-precision numeric types. Inexact means that some values cannot be converted exactly to the internal format and are stored as approximations, so that storing and retrieving a value might show slight discrepancies. More...

#include <Float.hpp>

Collaboration diagram for NES::Float:
[legend]

Public Member Functions

 Float (int8_t bits, double lowerBound, double upperBound) noexcept
 Constructs a new Float type. More...
 
 ~Float () override=default
 
bool isFloat () const override
 Checks if this data type is Float. More...
 
bool equals (DataTypePtr otherDataType) override
 Checks if two data types are equal. More...
 
DataTypePtr join (DataTypePtr otherDataType) override
 Calculates the joined data type between this data type and the other. If they have no possible joined data type, the coined type is Undefined. Floats, we can join with all numeric data types. More...
 
std::string toString () override
 Returns a string representation of the data type. More...
 
- Public Member Functions inherited from NES::Numeric
 Numeric (int8_t bits)
 
 ~Numeric () override=default
 
bool isNumeric () const final
 Checks if this data type is Numeric. More...
 
int8_t getBits () const
 Gets the bit size of this type. More...
 
- Public Member Functions inherited from NES::DataType
virtual ~DataType ()=default
 
virtual bool isUndefined () const
 Checks if this data type is Undefined. More...
 
virtual bool isBoolean () const
 Checks if this data type is Boolean. More...
 
virtual bool isInteger () const
 Checks if this data type is Integer. More...
 
virtual bool isArray () const
 Checks if this data type is ArrayType. More...
 
virtual bool isCharArray () const
 Checks if this data type is ArrayType. More...
 
virtual bool isChar () const
 Checks if this data type is Char. More...
 
virtual bool isText () const
 Checks if this data type is Char. More...
 

Public Attributes

double const lowerBound
 
double const upperBound
 

Additional Inherited Members

- Static Public Member Functions inherited from NES::DataType
template<class DataType >
static std::shared_ptr< DataTypeas (DataTypePtr ptr)
 
- Protected Attributes inherited from NES::Numeric
const int8_t bits
 

Detailed Description

Float precision are inexact, variable-precision numeric types. Inexact means that some values cannot be converted exactly to the internal format and are stored as approximations, so that storing and retrieving a value might show slight discrepancies.

Constructor & Destructor Documentation

◆ Float()

NES::Float::Float ( int8_t  bits,
double  lowerBound,
double  upperBound 
)
inlinenoexcept

Constructs a new Float type.

Parameters
bitsthe number of bits in which this type is represented.
lowerBoundthe lower bound, which is contained in that float.
upperBoundthe upper bound, which is contained in that float.

◆ ~Float()

NES::Float::~Float ( )
overridedefault

Member Function Documentation

◆ equals()

bool NES::Float::equals ( DataTypePtr  otherDataType)
overridevirtual

Checks if two data types are equal.

Parameters
otherDataType
Returns

Implements NES::DataType.

References NES::Numeric::bits, lowerBound, and upperBound.

◆ isFloat()

bool NES::Float::isFloat ( ) const
inlineoverridevirtual

Checks if this data type is Float.

Reimplemented from NES::DataType.

◆ join()

DataTypePtr NES::Float::join ( DataTypePtr  otherDataType)
overridevirtual

Calculates the joined data type between this data type and the other. If they have no possible joined data type, the coined type is Undefined. Floats, we can join with all numeric data types.

Parameters
otherdata type
Returns
DataTypePtr joined data type

Implements NES::DataType.

References NES::Numeric::bits, NES::DataTypeFactory::createFloat(), NES::DataTypeFactory::createUndefined(), lowerBound, and upperBound.

Here is the call graph for this function:

◆ toString()

std::string NES::Float::toString ( )
overridevirtual

Returns a string representation of the data type.

Returns
string

Implements NES::DataType.

References NES::Numeric::bits.

Member Data Documentation

◆ lowerBound

double const NES::Float::lowerBound

Referenced by equals(), and join().

◆ upperBound

double const NES::Float::upperBound

Referenced by equals(), and join().


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