Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::Range::Vector Class Reference

Type to contain and manipulate range lists. More...

#include <Range.h>

Inheritance diagram for sf::Range::Vector:
Collaboration diagram for sf::Range::Vector:

Public Member Functions

Vectorsort ()
 Sorts the vector according the Range operator '<'.
 
Vector sort () const
 Sorts the vector according the Range operator '<'.
 
Vectorrearrange ()
 Rearranges vector of ranges which means the vector is sorted and ranges are merged if possible.
 
 Vector (const Vector &rel) const
 Exclude the parts of the ranges in this vector which corresponds with the passed vector. Removes all the matching parts of in this vector of the passed vector. The current vector needs to be sorted for it to work.
 
Vector extract (const Vector &rl, Vector &rl_ex) const
 Extracts the covered ranges in the vector using the 'rl' vector and puts them in the 'rl_ex' vector.
 
Vectormerge (const Vector &rl_add)
 Adds the passed list to this vector and rearranges it.
 
- Public Member Functions inherited from sf::TVector< Range >
 TVector ()=default
 Default constructor.
 
 TVector (const TVector &v)
 Copy constructor.
 
 TVector (TVector &&) noexcept=default
 Move constructor.
 
 TVector (InputIterator first, InputIterator last)
 Initializing constructor using an iterator.
 
 TVector (std::initializer_list< value_type > list)
 Initializing constructor using list like:
TVector vect{1,2,3,4,5,6,7}
 
 TVector (const base_type &sv)
 Copy constructor for base type.
 
 TVector (size_type sz)
 Initializing constructor.
 
TVectoroperator= (const TVector &v) noexcept
 Assignment operator.
 
TVectoroperator= (TVector &&v) noexcept
 Assignment move operator.
 
size_type add (const Range &t)
 Adds item at the end of the vector.
 
size_type add (Range &&t)
 Adds item at the end of the vector.
 
size_type add (const TVector &)
 Adds the vectors items at the end of the vector.
 
TVectorappend (const Range &t)
 Appends an entry to the vectors items at the end of the vector.
 
TVectorappend (Range &&t)
 Appends an entry to the vectors items at the end of the vector.
 
TVectorprepend (const Range &t)
 Prepends an entry to the vectors items at the beginning of the vector.
 
TVectorprepend (Range &&t)
 Prepends an entry to the vectors items at the beginning of the vector.
 
bool addAt (const Range &t, size_type index)
 Adds an item at index position.
 
bool addAt (Range &&t, size_type index)
 Adds an item at index position.
 
bool detach (const Range &t)
 Removes specific item from the list by instance. Uses the compare operator from type T to find it.
 
bool detachAt (size_type index)
 Removes specific item from the list by index.
 
bool isEmpty () const
 Returns true when empty false otherwise.
 
void flush ()
 Removes all entries from the vector.
 
void flush (size_type stop, size_type start=0)
 Removes specific range of entries from the vector.
 
size_type find (const Range &) const
 Finds an entry by instance in the vector.
 
size_type count () const
 Returns the amount of entries in the vector.
 
Rangefirst ()
 Gets the first element of the vector.
 
const Rangefirst () const noexcept
 Gets the first element of the vector.
 
Rangelast ()
 Gets the last element of the vector.
 
const Rangelast () const noexcept
 Gets the last element of the vector.
 
bool startsWith (Range t) const
 Checks if the first element is of the passed value.
 
bool endsWith (Range t) const
 Checks if the last element is of the passed value.
 
Rangeget (size_type i)
 Gets entry from index position.
 
const Rangeget (size_type i) const
 Const version of getting entry from index position.
 
base_type getBase ()
 Returns the base type to access it methods explicitly.
 
base_type getBase () const
 Returns the constant const base type.
 
Rangeoperator[] (size_type i)
 Array operator Array operator needs reimplementation using std::vector::at() which does a range check in contrast to the std::vector::operator[] functions.
 
const Rangeoperator[] (size_type i) const
 Const array operator. Array operator needs reimplementation using std::vector::at() which does a range check in contrast to the std::vector::operator[] functions.
 
std::ostream & write (std::ostream &os, bool inc_hex) const
 

Public Attributes

Vector &const Vectorrl_ex
 Same as exclude but non const and the vector is modified.
 

Additional Inherited Members

- Public Types inherited from sf::TVector< Range >
typedef std::vector< Rangebase_type
 Base type of this template .
 
typedef base_type::size_type size_type
 Size type of this template.
 
typedef base_type::value_type value_type
 Value type contained by this vector template.
 
typedef TIterator< value_typeiter_type
 Iteration type of the template.
 
typedef const iter_type const_iter_type
 Iteration const type of the template.
 
- Static Public Attributes inherited from sf::TVector< Range >
static const size_t npos
 Value returned by various member functions when they fail.
 

Detailed Description

Type to contain and manipulate range lists.

Constructor & Destructor Documentation

◆ Vector()

sf::Range::Vector::Vector ( const Vector rel) const

Exclude the parts of the ranges in this vector which corresponds with the passed vector. Removes all the matching parts of in this vector of the passed vector. The current vector needs to be sorted for it to work.

Returns
Sorted vector.

Member Function Documentation

◆ extract()

Vector sf::Range::Vector::extract ( const Vector rl,
Vector rl_ex 
) const

Extracts the covered ranges in the vector using the 'rl' vector and puts them in the 'rl_ex' vector.

Returns
The resulting vector.
Parameters
rlRange vector to compare with for coverage. (must be rearranged sorted/merged)
rl_exReturns ranges that were covered. (The ID's of the ranges are preserved)
Returns
Vector containing the range leftover after extraction.

◆ merge()

Vector & sf::Range::Vector::merge ( const Vector rl_add)

Adds the passed list to this vector and rearranges it.

Returns
This resulting vector.

◆ rearrange()

Vector & sf::Range::Vector::rearrange ( )

Rearranges vector of ranges which means the vector is sorted and ranges are merged if possible.

◆ sort() [1/2]

Vector & sf::Range::Vector::sort ( )

Sorts the vector according the Range operator '<'.

Returns
Itself

◆ sort() [2/2]

Vector sf::Range::Vector::sort ( ) const

Sorts the vector according the Range operator '<'.

Returns
A sorted copy of itself.

Member Data Documentation

◆ rl_ex

Vector& const Vector& sf::Range::Vector::rl_ex

Same as exclude but non const and the vector is modified.

Returns
This resulting vector.

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