ActiveLib
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
active::serialise::xml::XMLNumber Class Referenceabstract

#include <XMLNumber.h>

Inheritance diagram for active::serialise::xml::XMLNumber:
Inheritance graph
[legend]
Collaboration diagram for active::serialise::xml::XMLNumber:
Collaboration graph
[legend]

Public Types

typedef ValueWrap< double > base
 
- Public Types inherited from active::serialise::ValueWrap< double >
using base
 Item reference base.
 
- Public Types inherited from active::serialise::Item
enum class  Type { text , number , boolean }
 
- Public Types inherited from active::serialise::Cargo
using Unique = std::unique_ptr<Cargo>
 Unique pointer.
 
using Shared = std::shared_ptr<Cargo>
 Shared pointer.
 
using size_type = std::string::size_type
 Class size type.
 
using sizeOption = std::optional<size_type>
 Optional size type (used to indicate an unspecified or non-existant position)
 

Public Member Functions

 XMLNumber (double &val)
 
virtual ~XMLNumber ()=default
 
virtual double getPrecision () const =0
 
virtual bool isPadded () const
 
virtual bool write (utility::String &dest) const
 
- Public Member Functions inherited from active::serialise::ValueWrap< double >
 ValueWrap (double &val)
 
 ValueWrap (const double &val)
 
virtual bool read (const utility::String &source) override
 
virtual bool read (const setting::Value &source) override
 
bool read (const utility::String &source)
 
bool read (const utility::String &source)
 
virtual void setDefault () override
 
virtual std::optional< Item::Type > type () const override
 
std::optional< Item::Type > type () const
 
std::optional< Item::Type > type () const
 
std::optional< Item::Type > type () const
 
- Public Member Functions inherited from active::serialise::Item
virtual bool fillInventory (Inventory &inventory) const
 
virtual Cargo::Unique getCargo (const Inventory::Item &item) const
 
- Public Member Functions inherited from active::serialise::Cargo
 Cargo ()
 
 Cargo (const Cargo &source)
 
virtual ~Cargo ()=default
 
virtual void clear ()
 
virtual bool validate ()
 

Detailed Description

Class for XML serialisation of numbers

Constructor & Destructor Documentation

◆ XMLNumber()

active::serialise::xml::XMLNumber::XMLNumber ( double & val)
inline

Constructor

Parameters
valThe data value

◆ ~XMLNumber()

virtual active::serialise::xml::XMLNumber::~XMLNumber ( )
virtualdefault

Destructor

Member Function Documentation

◆ getPrecision()

virtual double active::serialise::xml::XMLNumber::getPrecision ( ) const
pure virtual

Get the require floating point precision

Returns
The require floating point precision

Implemented in active::serialise::xml::XMLLength.

Here is the caller graph for this function:

◆ isPadded()

virtual bool active::serialise::xml::XMLNumber::isPadded ( ) const
inlinevirtual

Determine if the number is written with padding (zeros)

Returns
True if the number should be padded to the specified precision
Here is the caller graph for this function:

◆ write()

virtual bool active::serialise::xml::XMLNumber::write ( utility::String & dest) const
inlinevirtual

Write the item data to a string

Parameters
destThe string to write the data to
Returns
True if the data was successfully written

Reimplemented from active::serialise::ValueWrap< double >.

Here is the call graph for this function:

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