User Documentation
RAVL, Recognition And Vision Library
DEVELOP HOME PAGE CLASS LIST CONTENTS
Ravl - Core - Arrays - Buffer - RangeBufferAccessC<class DataT>
 

  PUBLIC
RangeBufferAccessC::RangeBufferAccessC(DataT *,const IndexRangeC &)
RangeBufferAccessC::RangeBufferAccessC(const IndexRangeC &,DataT *)
RangeBufferAccessC::RangeBufferAccessC(const BufferAccessC &,const IndexRangeC &)
RangeBufferAccessC::RangeBufferAccessC(const IndexRangeC &,const BufferAccessC &)
RangeBufferAccessC::RangeBufferAccessC(const RangeBufferAccessC &)
RangeBufferAccessC::RangeBufferAccessC(const RangeBufferAccessC &,const IndexRangeC &)
RangeBufferAccessC::operator =(DataT *)
RangeBufferAccessC::DataStart(void)
RangeBufferAccessC::DataStart(void) const
RangeBufferAccessC::Size(void) const
RangeBufferAccessC::Range(void) const
RangeBufferAccessC::IMin(void) const
RangeBufferAccessC::IMax(void) const
RangeBufferAccessC::operator [](IndexC) const
RangeBufferAccessC::operator [](IndexC)
RangeBufferAccessC::RAccess(void) const
RangeBufferAccessC::IsEmpty(void) const
RangeBufferAccessC::Contains(IndexC) const
RangeBufferAccessC::IsOverlapping(const RangeBufferAccessC &) const
RangeBufferAccessC::operator +=(SizeT)
RangeBufferAccessC::operator +(SizeT) const
RangeBufferAccessC::ShrinkHigh(SizeT)
RangeBufferAccessC::ShiftIndexes(IndexC)
RangeBufferAccessC::SetSubRange(IndexC,IndexC)
RangeBufferAccessC::Swap(RangeBufferAccessC &)
RangeBufferAccessC::Swap(IndexC,IndexC)
RangeBufferAccessC::Attach(const RangeBufferAccessC &)
RangeBufferAccessC::Attach(const BufferAccessC &,const IndexRangeC &)
RangeBufferAccessC::BufferFrom(IndexC)
RangeBufferAccessC::BufferFrom(IndexC,UIntT)
RangeBufferAccessC::Fill(const DataT &)
RangeBufferAccessC::Reverse(void)
RangeBufferAccessC::operator ==(const RangeBufferAccessC &) const
BufferAccessC::ReferenceElm(void) const
BufferAccessC::ReferenceVoid(void) const
BufferAccessC::IsValid(void) const
BufferAccessC::operator [](const IndexC) const
BufferAccessC::operator [](const IndexC)
BufferAccessC::operator +=(IndexC)
BufferAccessC::operator -=(IndexC)
BufferAccessC::operator -(IndexC) const
BufferAccessC::operator +(IndexC) const
BufferAccessC::operator ==(const BufferAccessC &) const
BufferAccessC::operator !=(const BufferAccessC &) const

   RangeBufferAccessC<class DataT>   
 
Basic access to buffer with limited range
 
include "Ravl/RBfAcc.hh"
Created:26/2/1997 
User Level:Develop
Library:RavlCore
Example:exRBfAcc.cc
In Scope:RavlN

Comments:
The class RangeBufferAccessC enables to random indexed access to a sequentially organised continous part of memory called buffer. The access functions check if an accessed element is valid only in debug mode.

Parent Classes: Derived Classes: Typedefs:
typedef DataT ElementT;
Constructors, copies, assigment, and destructor -----------------------------------------------

Variables:
Methods:
RangeBufferAccessC(DataT * bp = 0,const IndexRangeC & r = 0)
Creates an access to a buffer pointed by the pointer 'bp'.
If 'bp' is 0, the access is not valid. 'bp' Is assumed to point to the r.Min() element of the array.

RangeBufferAccessC(const IndexRangeC & r,DataT * bp)
Creates an access to a buffer pointed by the pointer 'bp'.
Where bp has already had r.LCol() subtracted from it. This is has been introduced to allow a bug fix in the class ImageC.

RangeBufferAccessC(const BufferAccessC<DataT> & bp,const IndexRangeC & r)
Creates an access to a buffer referenced by 'bp' with range 'r'.
the first element in 'bp' will be moved to offset 'r.Min()'.

RangeBufferAccessC(const IndexRangeC & r,const BufferAccessC<DataT> & bp)
Creates an access to a buffer referenced by 'bp' with range 'r'.
This assumes 'bp' has already been shifted so range 'r' will index valid elements.

RangeBufferAccessC(const RangeBufferAccessC<DataT> & ba)
Creates a new access to 'ba'.

RangeBufferAccessC(const RangeBufferAccessC<DataT> & ba,const IndexRangeC & r)
Creates a new access to 'ba' limited by range 'r'.

const RangeBufferAccessC<DataT> & operator =(DataT * bp)
Changes the reference element to the element pointed by 'bp'.
Access to the object -------------------- inline const BufferAccessC & Access(void) const; Returns this object.

DataT * DataStart()
Returns the address of the first element of the buffer.

const DataT * DataStart() const
Returns the address of the first element of the buffer.

SizeT Size() const
Returns the number of elements of the array.

const IndexRangeC & Range() const
Returns the usable range of indeces expressed by this object.

IndexC IMin() const
Returns the minimum index of the range of this access.

IndexC IMax() const
Returns the maximum index of the range of this access.

const DataT & operator [](IndexC i) const
Read-only access to the ('i'+1)-th element of the buffer.

DataT & operator [](IndexC i)
Read-write access to the ('i'+1)-th element of the buffer.

const RangeBufferAccessC<DataT> & RAccess(void) const
Returns this object. Logical functions -----------------

bool IsEmpty() const
Returns TRUE if the size of the array is zero.

bool Contains(IndexC i) const
Returns TRUE if the array contains an item with the index 'i'.

bool IsOverlapping(const RangeBufferAccessC<DataT> & acc) const
Returns TRUE if this access has an item with the same index as an item of the access 'acc'. Modifications of the access ---------------------------

const RangeBufferAccessC<DataT> & operator +=(SizeT i)
Changes indeces of the access to be 'i' units higher.

RangeBufferAccessC<DataT> operator +(SizeT i) const
Creates the new access object with the indeces 'i' units higher than those used in this access object.

const IndexRangeC & ShrinkHigh(SizeT k)
Changes the number of elements by subtracting the last 'k' elements.

void ShiftIndexes(IndexC offset)
All indexes of the items will be changed by 'offset'.
The range will be shifted by -offset.

void SetSubRange(IndexC newMin,IndexC newMax)
Constrain the indexs that can be accessed from the array.
The range of indexes of this array will be constrained to cover the index range at most.

const RangeBufferAccessC<DataT> & Swap(RangeBufferAccessC<DataT> & a)
Exchanges the contents of this buffer with buffer 'a'.

void Swap(IndexC i1,IndexC i2)
Exchanges the contents of elements with indeces 'i1' and 'i2'.

void Attach(const RangeBufferAccessC<DataT> & b)
Changes this buffer access to have the same access rights as 'b'.

void Attach(const BufferAccessC<DataT> & b,const IndexRangeC & r)
Changes this buffer access to have the access rights as 'b' limited by range 'r'. so the first element in 'b' is accessed at 'r.Min()'.

RangeBufferAccessC<DataT> BufferFrom(IndexC first)
Get an access for this buffer starting from the 'first' element to the end of the buffer.

RangeBufferAccessC<DataT> BufferFrom(IndexC first,UIntT len)
Get an access for this buffer starting from the 'first' element for 'len' elements.
An error will be generated if the requested buffer isn't contains within this one. Modifications of the buffer contents ------------------------------------

void Fill(const DataT & d)
Fill the buffer with the value 'd'.

void Reverse()
Reverse the order of elements in this array in place.

bool operator ==(const RangeBufferAccessC<DataT> & ba) const
Are two accesses the same ?

#include "Ravl/BufferAccess.hh"
DataT * ReferenceElm() const
Returns the pointer to the reference element of the attached buffer. The reference element need not to be the valid element of the buffer.

void * ReferenceVoid() const
Returns the pointer to the reference element of the attached buffer. The reference element need not to be the valid element of the buffer. The function is intended to be used in printing.

bool IsValid() const
Returns TRUE if this buffer access is not a default access object.

const DataT & operator [](const IndexC i) const
Read-only access to the ('i'+1)-th element of the buffer.

DataT & operator [](const IndexC i)
Read-write access to the ('i'+1)-th element of the buffer.

const BufferAccessC<DataT> & operator +=(IndexC ind)
Inplace Add index to start position.

const BufferAccessC<DataT> & operator -=(IndexC ind)
Inplace Subtract index from start position.

BufferAccessC<DataT> operator -(IndexC ind) const
Substract value from position, and return it as a new value.

BufferAccessC<DataT> operator +(IndexC ind) const
Substract value from position, and return it as a new value.

bool operator ==(const BufferAccessC<DataT> & ba) const
Are two accesses the same ?

bool operator !=(const BufferAccessC<DataT> & ba) const
Are two accesses the same ?


Maintainer:Radek Marik, Created: 26/2/1997, Documentation by CxxDoc: Tue Aug 13 09:59:02 2002