bpp-core3  3.0.0
bpp::Number< T > Class Template Reference

The Number object template class. More...

#include <Bpp/Numeric/Number.h>

+ Inheritance diagram for bpp::Number< T >:
+ Collaboration diagram for bpp::Number< T >:

Public Member Functions

 Number (const T &value=0)
 Build a new Number object with a specific value. More...
 
virtual ~Number ()
 
Number< T > & operator= (const T &t)
 
getValue () const
 Get the value of this number. More...
 
std::string toString () const
 
The Clonable interface.
Number< T > * clone () const
 Create a copy of this object and send a pointer to it. More...
 

Protected Attributes

value_
 The value of this parameter. More...
 

Detailed Description

template<class T>
class bpp::Number< T >

The Number object template class.

This template class may be used to deal with number in an object way.

Definition at line 91 of file Number.h.

Constructor & Destructor Documentation

◆ Number()

template<class T >
bpp::Number< T >::Number ( const T &  value = 0)
inline

Build a new Number object with a specific value.

Parameters
valueThe value that the Number must have.

Definition at line 103 of file Number.h.

◆ ~Number()

template<class T >
virtual bpp::Number< T >::~Number ( )
inlinevirtual

Definition at line 105 of file Number.h.

Member Function Documentation

◆ clone()

template<class T >
Number<T>* bpp::Number< T >::clone ( ) const
inlinevirtual

Create a copy of this object and send a pointer to it.

Returns
A pointer toward the copy object.

Implements bpp::BppNumberI.

Definition at line 119 of file Number.h.

References bpp::Number< T >::value_.

◆ getValue()

template<class T >
T bpp::Number< T >::getValue ( ) const
inline

Get the value of this number.

Returns
The value of this number.

Definition at line 128 of file Number.h.

References bpp::Number< T >::value_.

◆ operator=()

template<class T >
Number<T>& bpp::Number< T >::operator= ( const T &  t)
inline

Definition at line 107 of file Number.h.

References bpp::Number< T >::value_.

◆ toString()

template<class T >
std::string bpp::Number< T >::toString ( ) const
inlinevirtual

Implements bpp::BppNumberI.

Definition at line 130 of file Number.h.

References bpp::TextTools::toString(), and bpp::Number< T >::value_.

Member Data Documentation

◆ value_

template<class T >
T bpp::Number< T >::value_
protected

The value of this parameter.

Definition at line 95 of file Number.h.

Referenced by bpp::Number< T >::clone(), bpp::Number< T >::getValue(), bpp::Number< T >::operator=(), and bpp::Number< T >::toString().


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