SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Friends | List of all members
slip::Range< T > Class Template Reference

This is a Range class. More...

#include <GrayscaleImage.hpp>

Inheritance diagram for slip::Range< T >:
Inheritance graph

Public Types

typedef Range< SubType > self
 

Public Member Functions

std::string name () const
 Returns the name of the class. More...
 
SubType start () const
 Accessor of the start subscript of the Range. More...
 
SubType stop () const
 Accessor of the stop subscript of the Range. More...
 
int stride () const
 Accessor of the stride of the Range. More...
 
std::size_t iterations () const
 Rerturns the number of iterations of the range. More...
 
bool is_valid () const
 Returns true if the range is valid : More...
 
Constructors & Destructors
 Range ()
 Constructs a default Range start_sub = stop_sub = stride = 0. More...
 
 Range (const SubType &start_sub, const SubType &stop_sub, const int stride=1)
 Constructs a Range. More...
 

Friends

class boost::serialization::access
 
i/o operators
std::ostream & operator<< (std::ostream &out, const self &r)
 Write the Range to the ouput stream. More...
 
Comparison operators
bool operator== (const Range< SubType > &r1, const Range< SubType > &r2)
 Compare two Range. More...
 
bool operator!= (const Range< SubType > &r1, const Range< SubType > &r2)
 Compare two ranges. More...
 

Detailed Description

template<class T>
class slip::Range< T >

This is a Range class.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Version
0.0.2
Date
2014/04/02
Since
1.0.0
Parameters
SubTypeSubscript type of the Range

Definition at line 131 of file GrayscaleImage.hpp.

Member Typedef Documentation

template<class T>
typedef Range<SubType> slip::Range< T >::self

Definition at line 120 of file Range.hpp.

Constructor & Destructor Documentation

template<typename SubType >
slip::Range< SubType >::Range ( )
inline

Constructs a default Range start_sub = stop_sub = stride = 0.

Definition at line 260 of file Range.hpp.

template<typename SubType >
slip::Range< SubType >::Range ( const SubType &  start_sub,
const SubType &  stop_sub,
const int  stride = 1 
)
inline

Constructs a Range.

Parameters
start_subStart subscript
stop_subStop subscript  
strideStride of the range

Definition at line 266 of file Range.hpp.

Member Function Documentation

template<typename SubType >
bool slip::Range< SubType >::is_valid ( ) const
inline

Returns true if the range is valid :

  • if stride >= 0 : start_sub_ <= stop_sub_
  • if stride <=0 : start_sub >= stop_sub_ else false.
    Returns
    a boolean.

Definition at line 322 of file Range.hpp.

template<typename SubType >
std::size_t slip::Range< SubType >::iterations ( ) const
inline

Rerturns the number of iterations of the range.

Returns
the number of iteration of the Range

Definition at line 305 of file Range.hpp.

template<typename SubType >
std::string slip::Range< SubType >::name ( ) const
inline

Returns the name of the class.

Definition at line 276 of file Range.hpp.

template<typename SubType >
SubType slip::Range< SubType >::start ( ) const
inline

Accessor of the start subscript of the Range.

Returns
the start subscript.

Definition at line 284 of file Range.hpp.

template<typename SubType >
SubType slip::Range< SubType >::stop ( ) const
inline

Accessor of the stop subscript of the Range.

Returns
the stop subscript.

Definition at line 291 of file Range.hpp.

template<typename SubType >
int slip::Range< SubType >::stride ( ) const
inline

Accessor of the stride of the Range.

Returns
the stride.

Definition at line 298 of file Range.hpp.

Friends And Related Function Documentation

template<class T>
friend class boost::serialization::access
friend

Definition at line 235 of file Range.hpp.

template<class T>
bool operator!= ( const Range< SubType > &  r1,
const Range< SubType > &  r2 
)
friend

Compare two ranges.

Parameters
r1First range.
r2Second range.
Returns
true iff !(r1 == r2).

Definition at line 359 of file Range.hpp.

template<class T>
std::ostream& operator<< ( std::ostream &  out,
const self r 
)
friend

Write the Range to the ouput stream.

Parameters
outoutput stream
rRange to write to the output stream

Definition at line 339 of file Range.hpp.

template<class T>
bool operator== ( const Range< SubType > &  r1,
const Range< SubType > &  r2 
)
friend

Compare two Range.

Parameters
r1First range.
r2Second range.
Returns
true iff : (r1.start_sub_ == r2.start_sub_) && (r1.stop_sub_ = r2.stop_sub_) && (r1.stride_ == r2.stride_)

Definition at line 348 of file Range.hpp.


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