VISR  0.11.1
Versatile Interactive Scene Renderer
visr::rbbl::FloatSequence< ElementType > Class Template Reference

#include <float_sequence.hpp>

Public Types

using ContainerType = std::vector< ElementType >
 

Public Member Functions

 FloatSequence ()
 
 FloatSequence (ElementType val, std::size_t num=1)
 
 FloatSequence (ElementType const *const val, std::size_t numValues)
 
 FloatSequence (std::initializer_list< ElementType > const &val)
 
 FloatSequence (std::string const &val)
 
std::size_t size () const
 
ElementType * values ()
 
ElementType const * values () const
 
ContainerType::const_iterator begin () const
 
ContainerType::const_iterator end () const
 
ContainerType::iterator begin ()
 
ContainerType::iterator end ()
 
ElementType & operator[] (std::size_t idx)
 
ElementType const & operator[] (std::size_t idx) const
 
ElementType & at (std::size_t idx)
 
ElementType const & at (std::size_t idx) const
 
void clear ()
 
std::string toString (std::string const &separator=std::string(", ")) const
 

Detailed Description

template<typename ElementType>
class visr::rbbl::FloatSequence< ElementType >

Sequence of floating-point sequence that can be parsed from strings.

Template Parameters
The(floating-point) element type. Instantiations existfor float and double.

Member Typedef Documentation

◆ ContainerType

template<typename ElementType >
using visr::rbbl::FloatSequence< ElementType >::ContainerType = std::vector<ElementType>

Constructor & Destructor Documentation

◆ FloatSequence() [1/5]

template<typename ElementType >
visr::rbbl::FloatSequence< ElementType >::FloatSequence ( )

Default constructor, creates empty list.

◆ FloatSequence() [2/5]

template<typename ElementType >
visr::rbbl::FloatSequence< ElementType >::FloatSequence ( ElementType  val,
std::size_t  num = 1 
)
explicit

Construct sequence with num repetitions of val.

◆ FloatSequence() [3/5]

template<typename ElementType >
visr::rbbl::FloatSequence< ElementType >::FloatSequence ( ElementType const *const  val,
std::size_t  numValues 
)
explicit

Construct a float sequence out of a C-style array with a given number of elements.

Parameters
valPointer to the data array.
numValuesNumber of data elements.

◆ FloatSequence() [4/5]

template<typename ElementType >
visr::rbbl::FloatSequence< ElementType >::FloatSequence ( std::initializer_list< ElementType > const &  val)
explicit

Construct a float sequence from a C++ initializer list.

Parameters
valinitializer list (literal list of floating point values as { 0.0, 0.3, 0.4 }

◆ FloatSequence() [5/5]

template<typename ElementType >
visr::rbbl::FloatSequence< ElementType >::FloatSequence ( std::string const &  val)
explicit

Create an object from an a string representation.

Parameters
valA string containig a comma-separated sequence of float values or Matlab-style ranges "start:stride:end"

Internal object which is called by the spirit parser to hold the results of parsing.

Member Function Documentation

◆ at() [1/2]

template<typename ElementType >
ElementType& visr::rbbl::FloatSequence< ElementType >::at ( std::size_t  idx)
inline

Element access with bounds checking

◆ at() [2/2]

template<typename ElementType >
ElementType const& visr::rbbl::FloatSequence< ElementType >::at ( std::size_t  idx) const
inline

Element access with bounds checking, constant version

◆ begin() [1/2]

template<typename ElementType >
ContainerType::const_iterator visr::rbbl::FloatSequence< ElementType >::begin ( ) const
inline

◆ begin() [2/2]

template<typename ElementType >
ContainerType::iterator visr::rbbl::FloatSequence< ElementType >::begin ( )
inline

◆ clear()

template<typename ElementType >
void visr::rbbl::FloatSequence< ElementType >::clear ( )

Reset the list to an empty state.

◆ end() [1/2]

template<typename ElementType >
ContainerType::const_iterator visr::rbbl::FloatSequence< ElementType >::end ( ) const
inline

◆ end() [2/2]

template<typename ElementType >
ContainerType::iterator visr::rbbl::FloatSequence< ElementType >::end ( )
inline

◆ operator[]() [1/2]

template<typename ElementType >
ElementType& visr::rbbl::FloatSequence< ElementType >::operator[] ( std::size_t  idx)
inline

Element access without bounds checking

◆ operator[]() [2/2]

template<typename ElementType >
ElementType const& visr::rbbl::FloatSequence< ElementType >::operator[] ( std::size_t  idx) const
inline

Element access without bounds checking, constant version

◆ size()

template<typename ElementType >
std::size_t visr::rbbl::FloatSequence< ElementType >::size ( ) const
inline

◆ toString()

template<typename ElementType >
std::string visr::rbbl::FloatSequence< ElementType >::toString ( std::string const &  separator = std::string(", ")) const

Transform the contents ito a textual representation.

Parameters
separatorThe separator put in between adjacent values.
Returns
String representation of the floating-point sequence

◆ values() [1/2]

template<typename ElementType >
ElementType* visr::rbbl::FloatSequence< ElementType >::values ( )
inline

◆ values() [2/2]

template<typename ElementType >
ElementType const* visr::rbbl::FloatSequence< ElementType >::values ( ) const
inline

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