cartobase  4.7.0
carto::ScalarInterface Class Referenceabstract

All scalar numbers implement the ScalarInterface (all ints, float, double...) More...

#include <cartobase/object/object.h>

Inheritance diagram for carto::ScalarInterface:
Collaboration diagram for carto::ScalarInterface:

Public Member Functions

virtual ~ScalarInterface ()
 
virtual bool isScalar () const
 Returns false if the stored object doesn't actually implement the ScalarInterface API (needed since all GenericObject inherit this interface whatever they actually contain) More...
 
virtual double getScalar () const =0
 Obtain a scalar value, possibly after a conversion. More...
 
virtual void setScalar (double)=0
 The double value will be converted to the actual storage type before it is set in the contained object. More...
 
virtual bool operator== (const ScalarInterface &other) const
 equality test More...
 
virtual bool operator!= (const ScalarInterface &other) const
 
- Public Member Functions inherited from carto::Interface
virtual ~Interface ()
 

Detailed Description

All scalar numbers implement the ScalarInterface (all ints, float, double...)

Definition at line 109 of file object.h.

Constructor & Destructor Documentation

◆ ~ScalarInterface()

virtual carto::ScalarInterface::~ScalarInterface ( )
virtual

Member Function Documentation

◆ getScalar()

virtual double carto::ScalarInterface::getScalar ( ) const
pure virtual

Obtain a scalar value, possibly after a conversion.

This method may throw an exception if the stored object has not a scalar-compatible interface

Implemented in carto::TypedObject< T >, and carto::TypedObject< SyntaxedInterfaceType< T > >.

◆ isScalar()

virtual bool carto::ScalarInterface::isScalar ( ) const
virtual

Returns false if the stored object doesn't actually implement the ScalarInterface API (needed since all GenericObject inherit this interface whatever they actually contain)

Reimplemented in carto::TypedObject< T >, and carto::TypedObject< SyntaxedInterfaceType< T > >.

Referenced by carto::TypedObject< SyntaxedInterfaceType< T > >::operator==().

◆ operator!=()

virtual bool carto::ScalarInterface::operator!= ( const ScalarInterface other) const
inlinevirtual

Definition at line 133 of file object.h.

References operator==().

◆ operator==()

virtual bool carto::ScalarInterface::operator== ( const ScalarInterface other) const
virtual

equality test

◆ setScalar()

virtual void carto::ScalarInterface::setScalar ( double  )
pure virtual

The double value will be converted to the actual storage type before it is set in the contained object.

This method may throw an exception if the stored object has not a scalar-compatible interface

Implemented in carto::TypedObject< T >, and carto::TypedObject< SyntaxedInterfaceType< T > >.


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