|
WPOCT Software Developer's Kit (SDK)
SDK For using Wasatch Photonics OCT Spectrometers
|
A general purpose templated class that holds a programmable number of buffers, each the same size. More...
#include <SameSizeBuffers.h>
Public Member Functions | |
| SameSizeBuffers () | |
| Initializes a new instance of the SameSizeBuffers<T, U> class. More... | |
| SameSizeBuffers (int sizeOfBuffer) | |
| Initializes a new instance of the SameSizeBuffers<T, U> class. More... | |
| SameSizeBuffers (int sizeOfBuffer, int numBuffers) | |
| Initializes a new instance of the SameSizeBuffers<T, U> class and creates the buffers specified. More... | |
| virtual | ~SameSizeBuffers () |
| Finalizes an instance of the SameSizeBuffers<T, U> class. More... | |
| int | GetNumBuffers () const |
| int | GetBufferSize () const |
| int | GetCurrentBuffer () const |
| int | GetFirstBufferIndex () const |
| int | GetNumBuffersInRing () const |
| int | GetNextBufferIndex () |
| Gets the index of the next buffer in the circular queue. More... | |
| T * | operator[] (int index) |
| Returns a pointer to the buffer specified by the index. More... | |
| void | SetCurrentBuffer (int value) |
| Sets the value of the current buffer. More... | |
| int | ResetCurrentBuffer () |
| Resets the current buffer to the index of the first buffer in the circular queue. More... | |
| void | SetFirstBufferIndex (int value) |
| Sets the first index of the circular buffer. More... | |
| bool | CreateBuffers (int bufferSize, int numBuffers) |
| Creates the buffers specified by the supplied parameters. More... | |
| bool | SetBufferToValue (int index, U value) |
| Sets each element in the buffer to value supplied. More... | |
| bool | AddTogether (int sourceIndex, int destIndex) |
| Adds the source and destination buffers together and places the result in the destination. More... | |
| bool | Subtract (int sourceIndex, int destIndex) |
| Subtracts the source buffer from the destination buffer and places the result in the destination. More... | |
| bool | CopyBufferIn (U *buffer, int index) |
| Copies the buffer supplied to the buffer specified by the index. More... | |
| bool | AddBufferToAverage (U *buffer, int index, int divisor) |
| Copies the buffer supplied to the buffer specified by the index. More... | |
| bool | CopyBufferOut (U *buffer, int index) |
| Copies the buffer specified by the index out to the buffer supplied. More... | |
| void | Clear () |
| Deletes all buffers and the pointers to them. More... | |
A general purpose templated class that holds a programmable number of buffers, each the same size.
In addition, some or all of the buffers can be used as a circular queue.
| SameSizeBuffers< T, U >::SameSizeBuffers |
Initializes a new instance of the SameSizeBuffers<T, U> class.
| SameSizeBuffers< T, U >::SameSizeBuffers | ( | int | sizeOfBuffer | ) |
Initializes a new instance of the SameSizeBuffers<T, U> class.
| sizeOfBuffer | The size of each buffer. |
| SameSizeBuffers< T, U >::SameSizeBuffers | ( | int | sizeOfBuffer, |
| int | numBuffers | ||
| ) |
Initializes a new instance of the SameSizeBuffers<T, U> class and creates the buffers specified.
| sizeOfBuffer | The size of each buffer. |
| numBuffers | The number buffers. |
|
virtual |
Finalizes an instance of the SameSizeBuffers<T, U> class.
| bool SameSizeBuffers< T, U >::AddBufferToAverage | ( | U * | buffer, |
| int | index, | ||
| int | divisor | ||
| ) |
Copies the buffer supplied to the buffer specified by the index.
Each entry is divided by the divisor. This call can be used for averaging.
| buffer | The buffer to be copied from. |
| index | The index of the buffer to be copied to. |
| bool SameSizeBuffers< T, U >::AddTogether | ( | int | sourceIndex, |
| int | destIndex | ||
| ) |
Adds the source and destination buffers together and places the result in the destination.
| sourceIndex | Index of the source. |
| destIndex | Index of the dest. |
| void SameSizeBuffers< T, U >::Clear |
Deletes all buffers and the pointers to them.
| bool SameSizeBuffers< T, U >::CopyBufferIn | ( | U * | buffer, |
| int | index | ||
| ) |
Copies the buffer supplied to the buffer specified by the index.
| buffer | The buffer to be copied from. |
| index | The index of the buffer to be copied to. |
| bool SameSizeBuffers< T, U >::CopyBufferOut | ( | U * | buffer, |
| int | index | ||
| ) |
Copies the buffer specified by the index out to the buffer supplied.
The buffer to copy to must already be allocated.
| buffer | The buffer to be copied to. |
| index | The index of the buffer to be copied from. |
| bool SameSizeBuffers< T, U >::CreateBuffers | ( | int | bufferSize, |
| int | numBuffers | ||
| ) |
Creates the buffers specified by the supplied parameters.
| bufferSize | Size of each buffer. |
| numBuffers | The number of buffers. |
| int SameSizeBuffers< T, U >::GetNextBufferIndex |
Gets the index of the next buffer in the circular queue.
| T * SameSizeBuffers< T, U >::operator[] | ( | int | index | ) |
Returns a pointer to the buffer specified by the index.
| index | The index. |
| int SameSizeBuffers< T, U >::ResetCurrentBuffer |
Resets the current buffer to the index of the first buffer in the circular queue.
| bool SameSizeBuffers< T, U >::SetBufferToValue | ( | int | index, |
| U | value | ||
| ) |
Sets each element in the buffer to value supplied.
| index | The index of the buffer to initialize. |
| value | The value to initialize to. |
| void SameSizeBuffers< T, U >::SetCurrentBuffer | ( | int | value | ) |
Sets the value of the current buffer.
| value | The value. |
| void SameSizeBuffers< T, U >::SetFirstBufferIndex | ( | int | value | ) |
Sets the first index of the circular buffer.
| value | The value of the first index. |
| bool SameSizeBuffers< T, U >::Subtract | ( | int | sourceIndex, |
| int | destIndex | ||
| ) |
Subtracts the source buffer from the destination buffer and places the result in the destination.
| sourceIndex | Index of the source. |
| destIndex | Index of the destination. |