Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages | Examples

vetBuffer< T > Class Template Reference

Abstract template class for all VETLib buffers. More...

#include <vetBuffer.h>

Inheritance diagram for vetBuffer< T >:

vetBufferArray< T > vetBufferLink< T >

Public Types

enum  
 Ignore this, it's a class-type definition, mostly used by VETLib WorkShop, sintax is a bit more complex than usual because of a VC6 BUG, it's the same as: const int vetClassType = VETCLASS_TYPE_BUFFER;.

Public Member Functions

 vetBuffer ()
 Default constructor must be public.
virtual ~vetBuffer ()
 Default virtual destructor.
void setDoDataCopy (bool value=true)
 Tell the component to copy frames' data.
bool isDataCopyEnabled () const
 Get the state data-copy.
virtual VETRESULT reset ()=0
 Reset buffers' table and parameters, frame data is NOT cleaned!
virtual VETRESULT deleteFrames ()=0
 Delete all buffered frames and reset buffer.
virtual VETRESULT addFrame (T *newFrame)=0
 Add a new frame to the buffer, frames' count is updated. (new frame index will be v_fcount).
virtual VETRESULT insertFrame (long index, T *newFrame)=0
 Insert a frame at selected index. Following frames are moved. frames' count is updated.
virtual VETRESULT updateFrame (long index, T *newFrame, bool removeold)=0
 Update selected frame with new frame, old frame data is NOT cleaned! Use this function only if you know what you are doing.
virtual VETRESULT removeFrame (long index, bool freeData=false)=0
 Remove selected frame, frame data is NOT cleaned!
virtual VETRESULT removeFrame (T *frameToDelete, bool freeData=false)=0
 Remove selected frame, frame data is NOT cleaned!
long getFramesCount () const
 Get number of buffered frames.
virtual long getCurrentFrameIndex () const =0
 Get id of current frame.
virtual T * getFrame (long index)=0
 Get selected frame.
virtual VETRESULT goToNextFrame ()=0
 Move current frame's index to next frame (v_current_frame++).
virtual VETRESULT goToPreviousFrame ()=0
 Move current frame's index to previous frame (v_current_frame--).
virtual VETRESULT goToFirstFrame ()=0
 Move current frame's index to first frame (v_current_frame=0).
virtual VETRESULT goToLastFrame ()=0
 Move current frame's index to last frame (v_current_frame=v_fcount-1).
virtual VETRESULT goToFrame (long index)=0
 Move current frame's index to argument (v_current_frame=index).
virtual VETRESULT goToStepFrame (long offset)=0
 Move current frame's index adding argument to current index (v_current_frame+=offset).
virtual T * getLastFrame ()=0
 Get last frame (v_fcount).
virtual T * getFirstFrame ()=0
 Get first frame (0).
virtual T * getNextFrame ()=0
 Get next frame (current+1).
virtual T * getPreviousFrame ()=0
 Get previous frame (current-1).
virtual T * getCurrentFrame ()=0
 Get current selected frame.

Protected Attributes

long v_fcount
 buffered frames' count.
bool copyData
 if true frame are copied, not linked.

Detailed Description

template<class T>
class vetBuffer< T >

Abstract template class for all VETLib buffers.

Bug:
Warning:
Todo:
Version:
1.0.2
Date:
23/12/2005
Author:
Alessandro Polo
VETLib Framework 1.0.2 Copyright (C) Alessandro Polo 2006 http://www.ewgate.net/vetlib

Definition at line 31 of file vetBuffer.h.


Member Function Documentation

template<class T>
virtual VETRESULT vetBuffer< T >::addFrame T *  newFrame  )  [pure virtual]
 

Add a new frame to the buffer, frames' count is updated. (new frame index will be v_fcount).

Parameters:
[in] newFrame address of the new frame.
Returns:
VETRET_ILLEGAL_USE if current count reached max (VETDEF_FCOUNT_MAX), VETRET_OK else.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
virtual VETRESULT vetBuffer< T >::deleteFrames  )  [pure virtual]
 

Delete all buffered frames and reset buffer.

Returns:
VETRET_ILLEGAL_USE if buffer is empty, VETRET_OK else.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
virtual T* vetBuffer< T >::getCurrentFrame  )  [pure virtual]
 

Get current selected frame.

Returns:
address of current selected frame.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
virtual long vetBuffer< T >::getCurrentFrameIndex  )  const [pure virtual]
 

Get id of current frame.

Returns:
frame's index.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
virtual T* vetBuffer< T >::getFirstFrame  )  [pure virtual]
 

Get first frame (0).

Returns:
address of first frame.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
virtual T* vetBuffer< T >::getFrame long  index  )  [pure virtual]
 

Get selected frame.

Parameters:
[in] index frame's index.
Returns:
address of selected frame.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
long vetBuffer< T >::getFramesCount  )  const [inline]
 

Get number of buffered frames.

Returns:
frames' count.
See also:
v_fcount

Definition at line 169 of file vetBuffer.h.

References vetBuffer< T >::v_fcount.

template<class T>
virtual T* vetBuffer< T >::getLastFrame  )  [pure virtual]
 

Get last frame (v_fcount).

Returns:
address of last frame.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
virtual T* vetBuffer< T >::getNextFrame  )  [pure virtual]
 

Get next frame (current+1).

Returns:
address of next frame.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
virtual T* vetBuffer< T >::getPreviousFrame  )  [pure virtual]
 

Get previous frame (current-1).

Returns:
address of previous frame.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
virtual VETRESULT vetBuffer< T >::goToFirstFrame  )  [pure virtual]
 

Move current frame's index to first frame (v_current_frame=0).

Returns:
VETRET_ILLEGAL_USE if buffer is empty, VETRET_OK else.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
virtual VETRESULT vetBuffer< T >::goToFrame long  index  )  [pure virtual]
 

Move current frame's index to argument (v_current_frame=index).

Parameters:
[in] index frame index to set.
Returns:
VETRET_ILLEGAL_USE if buffer is empty, VETRET_PARAM_ERR if index is outside [0, v_fcount[, VETRET_OK else.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
virtual VETRESULT vetBuffer< T >::goToLastFrame  )  [pure virtual]
 

Move current frame's index to last frame (v_current_frame=v_fcount-1).

Returns:
VETRET_ILLEGAL_USE if buffer is empty, VETRET_OK else.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
virtual VETRESULT vetBuffer< T >::goToNextFrame  )  [pure virtual]
 

Move current frame's index to next frame (v_current_frame++).

Returns:
VETRET_ILLEGAL_USE if buffer is empty or if current index is greater than buffer's size, VETRET_OK else.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
virtual VETRESULT vetBuffer< T >::goToPreviousFrame  )  [pure virtual]
 

Move current frame's index to previous frame (v_current_frame--).

Returns:
VETRET_ILLEGAL_USE if buffer is empty or if current index is 0, VETRET_OK else.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
virtual VETRESULT vetBuffer< T >::goToStepFrame long  offset  )  [pure virtual]
 

Move current frame's index adding argument to current index (v_current_frame+=offset).

Parameters:
[in] offset number of frame to add to index (positive or negative).
Returns:
VETRET_ILLEGAL_USE if buffer is empty, VETRET_PARAM_ERR if final index is outside [0, v_fcount[, VETRET_OK else.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
virtual VETRESULT vetBuffer< T >::insertFrame long  index,
T *  newFrame
[pure virtual]
 

Insert a frame at selected index. Following frames are moved. frames' count is updated.

Parameters:
[in] index position of the new frame.
[in] newFrame address of the new frame.
Returns:
VETRET_ILLEGAL_USE if current count reached max (VETDEF_FCOUNT_MAX), VETRET_OK else.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
bool vetBuffer< T >::isDataCopyEnabled  )  const [inline]
 

Get the state data-copy.

Returns:
if true data will be copied, else only pointer is stored.

Definition at line 80 of file vetBuffer.h.

References vetBuffer< T >::copyData.

template<class T>
virtual VETRESULT vetBuffer< T >::removeFrame T *  frameToDelete,
bool  freeData = false
[pure virtual]
 

Remove selected frame, frame data is NOT cleaned!

Parameters:
[in] frameToDelete address of frame to delete
Returns:
VETRET_ILLEGAL_USE if buffer is empty, VETRET_PARAM_ERR if frame's address is not valid, VETRET_OK else.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
virtual VETRESULT vetBuffer< T >::removeFrame long  index,
bool  freeData = false
[pure virtual]
 

Remove selected frame, frame data is NOT cleaned!

Parameters:
[in] index frame's index to delete
Returns:
VETRET_ILLEGAL_USE if buffer is empty, VETRET_PARAM_ERR if index is not valid, VETRET_OK else.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
virtual VETRESULT vetBuffer< T >::reset  )  [pure virtual]
 

Reset buffers' table and parameters, frame data is NOT cleaned!

Returns:
VETRET_OK

Implemented in vetBufferArray< T >, and vetBufferLink< T >.

template<class T>
void vetBuffer< T >::setDoDataCopy bool  value = true  )  [inline]
 

Tell the component to copy frames' data.

Parameters:
[in] value if true data will be copied, else only pointer is stored.
See also:
docpyData

Definition at line 70 of file vetBuffer.h.

References vetBuffer< T >::copyData.

template<class T>
virtual VETRESULT vetBuffer< T >::updateFrame long  index,
T *  newFrame,
bool  removeold
[pure virtual]
 

Update selected frame with new frame, old frame data is NOT cleaned! Use this function only if you know what you are doing.

Parameters:
[in] index old frame's index.
[in] newFrame address of the updated frame.
Returns:
VETRET_ILLEGAL_USE if buffer is empty, VETRET_PARAM_ERR if frame's address is not valid, VETRET_OK else.

Implemented in vetBufferArray< T >, and vetBufferLink< T >.


The documentation for this class was generated from the following file:
Generated on Tue Jan 24 11:59:18 2006 for VETLib by  doxygen 1.4.4