fesa-core  7.0.0
fesa::ImmutableFunction Class Reference

#include <ImmutableFunction.h>

Inheritance diagram for fesa::ImmutableFunction:
fesa::Function

Public Member Functions

 ImmutableFunction (const ImmutableArray< Point > &data)
 Constructor using a function specified as an ImmutableArray. No copy of the data is performed. More...
 
 ImmutableFunction (const Point *data, std::size_t size)
 Constructor using a pointer to Points and a size. No copy of the data is performed. More...
 
 ImmutableFunction (const double *x, const double *y, std::size_t size)
 Constructor using a pointer to x and y coordinates, and a size. No copy of the data is performed. More...
 
 ImmutableFunction (const_iterator first, const_iterator last)
 Constructor using iterators to the first and last point (last excluded). More...
 
 ImmutableFunction ()
 
virtual Point getPoint (std::size_t index) const
 
virtual bool isValid () const
 
Function getMutable () const
 
virtual const_iterator begin () const
 
virtual const_iterator end () const
 
virtual std::size_t size () const
 

Detailed Description

Class which represents a function. Objects of this class don't copy data and are immutable. This means that the data used to instantiate them must remain accessible and constant until they are destroyed.

Constructor & Destructor Documentation

fesa::ImmutableFunction::ImmutableFunction ( const ImmutableArray< Point > &  data)

Constructor using a function specified as an ImmutableArray. No copy of the data is performed.

Parameters
dataan array of points describing a function
fesa::ImmutableFunction::ImmutableFunction ( const Point data,
std::size_t  size 
)

Constructor using a pointer to Points and a size. No copy of the data is performed.

Parameters
dataan array of points describing a function
sizethe number of elements in the array
fesa::ImmutableFunction::ImmutableFunction ( const double *  x,
const double *  y,
std::size_t  size 
)

Constructor using a pointer to x and y coordinates, and a size. No copy of the data is performed.

Parameters
xan array of x coordinates of points
yan array of y coordinates of points
sizethe number of elements in the array
fesa::ImmutableFunction::ImmutableFunction ( const_iterator  first,
const_iterator  last 
)

Constructor using iterators to the first and last point (last excluded).

Parameters
firstiterator pointing to the first point of the function
lastiterator pointing to the point after the last point of the function
fesa::ImmutableFunction::ImmutableFunction ( )

Instantiates an empty function.

Member Function Documentation

ImmutableFunction::const_iterator fesa::ImmutableFunction::begin ( ) const
virtual

Get a constant iterator pointing to the first point in the function

Reimplemented in fesa::Function.

ImmutableFunction::const_iterator fesa::ImmutableFunction::end ( ) const
virtual

Get a constant iterator pointing to the point after the last point in the function

Reimplemented in fesa::Function.

Function fesa::ImmutableFunction::getMutable ( ) const

Returns a Function object that contains a copy of this ImmutableFunction's data.

Point fesa::ImmutableFunction::getPoint ( std::size_t  index) const
virtual

Returns the point at the given index. Indexing starts at 0.

bool fesa::ImmutableFunction::isValid ( ) const
virtual

Returns true if the function is valid. valid function:

  • Points are ordered by rising x coordinates
  • No two points have the same x coordinate.

Reimplemented in fesa::Function.

std::size_t fesa::ImmutableFunction::size ( ) const
virtual
Returns
the number of points in the function

Reimplemented in fesa::Function.


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