fesa-core  4.3.1
fesa::Function Class Reference

#include <Function.h>

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

Public Member Functions

 Function (const ImmutableFunction &data)
 
template<class InputIterator >
 Function (InputIterator first, InputIterator last)
 
 Function ()
 
PointgetPoint (std::size_t index)
 
void addPoint (const Point &p)
 
bool isValid () const
 
const_iterator begin () const
 
const_iterator end () const
 
iterator begin ()
 
std::size_t size () const
 
- Public Member Functions inherited from fesa::ImmutableFunction
 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
 
Function getMutable () const
 

Detailed Description

Class which represents a function. It extends ImmutableFunction, adding methods to make it modifiable. Objects of this class always have their own data and are mutable.

Constructor & Destructor Documentation

fesa::Function::Function ( const ImmutableFunction data)

Constructor. Copies the data of an ImmutableFunction.

template<class InputIterator >
fesa::Function::Function ( InputIterator  first,
InputIterator  last 
)

Constructor. Copies points from iterators passed as arguments, range [first, last).

fesa::Function::Function ( )

Instantiates an empty function.

Member Function Documentation

void fesa::Function::addPoint ( const Point p)

Adds a point at the end of the function.

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

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

Reimplemented from fesa::ImmutableFunction.

Function::iterator fesa::Function::begin ( )

Get an iterator allowing modifications of points in the function

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

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

Reimplemented from fesa::ImmutableFunction.

Point & fesa::Function::getPoint ( std::size_t  index)

Returns a reference to the point at the given index. The reference may be used to modify the point.

bool fesa::Function::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 from fesa::ImmutableFunction.

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

Reimplemented from fesa::ImmutableFunction.


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