Class Index | Cross Index | Namespace Index |
This class represents vector data.
Contained in: FrameCPP::Version_3_4_5
Derived from:
FrameCPP::Version_3_4_5::Base
Derived by:
none
#include "../../../../../lib/framecpp/src/Version3_4_5/vect.hh"
public function member index: |
|||
Vect | (); | Default Constructor. | |
Vect | (const Vect& vect); | Copy Constructor. | |
Vect | (const std::string& name, INT_2U type, INT_4U nDim, const Dimension* dims, const ByteOrder byte_order = BIG, const void* data = 0, const std::string& unitY = ""); | Constructor. | |
Vect | (const std::string& name, INT_2U type, INT_4U nDim, const Dimension* dims, const ByteOrder byte_order = BIG, void* data = 0, const std::string& unitY = "", bool allocate = true, bool owns = true); | Constructor. | |
Vect | (const std::string& name, INT_2U type, INT_4U nDim, const INT_4U* dims, const ByteOrder byte_order = BIG, const void* data = 0, const std::string& unitY = ""); | Constructor. | |
Vect | (const std::string& name, INT_2U type, INT_4U nDim, const INT_4U* dims, const ByteOrder byte_order = BIG, void* data = 0, const std::string& unitY = "", bool allocate = true, bool owns = true); | Constructor. | |
Vect | (const std::string& name, INT_4U nDim = 1, const Dimension* dims = 0, const T* data = 0, const std::string& unitY = ""); | Constructor. | |
Vect | (const std::string& name, INT_4U nDim = 1, const Dimension* dims = 0, T* data = 0, const std::string& unitY = "", bool allocate = true, bool owns = true); | Constructor. | |
Vect | (const std::string& name, INT_4U nDim = 1, const INT_4U* dims = 0, const T* data = 0, const std::string& unitY = ""); | Constructor. | |
Vect | (const std::string& name, INT_4U nDim = 1, const INT_4U* dims = 0, T* data = 0, const std::string& unitY = "", bool allocate = true, bool owns = true); | Constructor. | |
virtual | ~Vect | (); | Destructor. |
void | byteSwapData | (); | Perform byte swapping operation on vector data |
void | compress | (Compression c, size_t level = 6); | Compress the data for this Vect. |
void | expand | (); | Expand compressed data. |
inline ByteOrder | getByteOrder | () const; | Get the byte ordering of the data. |
virtual INT_2U | getClassId | () const; | |
inline Compression | getCompress | () const; | Get the compression algorithm. |
inline void* | getData | (bool decompress = true); | Get a pointer to the data. |
inline const void* | getData | (bool decompress = true) const; | Get a pointer to the data. |
inline Dimension& | getDimension | (size_t index); | Get dimension information. |
inline const Dimension& | getDimension | (size_t index) const; | Get dimension information. |
inline INT_4U | getNBytes | () const; | Get the number of bytes in the compressed vector. |
inline INT_4U | getNData | () const; | Get the number of sampled elements in the data series. |
inline INT_4U | getNDim | () const; | Get the dimensionality of the data vector. |
const std::string& | getName | () const; | |
static SH | getSH | (); | Constructs the Structure Header for this class. |
static SH | getSH3 | (); | Constructs frame data format version 3 Structure Header for this class. |
static SH | getSH4 | (); | Constructs frame data format version 4 Structure Header for this class. |
inline INT_2U | getType | () const; | Get the vector data type. |
static size_t | getTypeSize | (INT_2U type); | Get size of single data point of particular size. |
inline const std::string& | getUnitY | () const; | Get the std::string describing how to interpret the value of each element. |
inline bool | isDataOwned | () const; | See if data is owned by this vector |
inline bool | operator != | (const Vect& vect) const; | Not-equal comparison. |
const Vect& | operator += | (const Vect& vect); | += Assignment Operator. |
const Vect& | operator = | (const Vect& vect); | Assignment Operator. |
bool | operator == | (const Vect& vect) const; | Equal comparison operator. |
void | setData | (const void* data); | Set the data. |
void | setData | (void* data, bool allocate = true, bool owns = true); | Set or adopt the data. |
inline void | setDataNeedsByteSwap | (bool swap); | Set byteswap required flag. |
inline void | setDataOwnership | (bool owns); | Set data ownership flag. |
void | setDimension | (std::vector<Dimension>& dims); | Set the dimensions. |
void | setNBytes | (INT_4U nb); | Set the number of data bytes. |
void | setNData | (INT_4U nd); | Set the number of data points. |
private function member index: |
|||
Vect | (const std::string& name, INT_4U nDim, const Dimension* dims, const COMPLEX_8* data, const std::string& unitY); | ||
Vect | (const std::string& name, INT_4U nDim, const Dimension* dims, const COMPLEX_16*, const std::string& unitY); | ||
Vect | (const std::string& name, INT_4U nDim, const Dimension* dims, COMPLEX_8* data, const std::string& unitY, bool allocate, bool owns); | ||
Vect | (const std::string& name, INT_4U nDim, const Dimension* dims, COMPLEX_16* data, const std::string& unitY, bool allocate, bool owns); | ||
Vect | (const std::string& name, INT_4U nDim, const INT_4U* dims, const COMPLEX_8* data, const std::string& unitY); | ||
Vect | (const std::string& name, INT_4U nDim, const INT_4U* dims, const COMPLEX_16* data, const std::string& unitY); | ||
Vect | (const std::string& name, INT_4U nDim, const INT_4U* dims, COMPLEX_8* data, const std::string& unitY, bool allocate, bool owns); | ||
Vect | (const std::string& name, INT_4U nDim, const INT_4U* dims, COMPLEX_16* data, const std::string& unitY, bool allocate, bool owns); | ||
static int | FrVectZComp | (unsigned short* out, unsigned long* compL, short* data, int nData, int bSize); | Suppress zeroes. |
static void | FrVectZExpand | (short* out, unsigned short* data, int nData); | Expand zero suppressed data. |
void | deleteData | (); | Delete owned data. |
void | diffCompress | (); | Differentially compress the data. |
void | diffCompressType | (); | Differentially compress the data. |
static Type | getDataType | (); | Template function to get the type ID corresponding to certain data type. |
void | gzipCompress | (size_t level); | Compress the data with GZip. |
static Vect* | read | (FrameReaderBase& in); | Reads an Vect object from an FrameReaderBase object. |
static Vect* | read3 | (FrameReaderBase& in); | Read legacy data vector. |
static Vect* | read4 | (FrameReaderBase& in); | Read legacy data vector. |
virtual void | write | (Output& out) const; | Writes a Vect object to an Output object. |
void | zCompress | (); | Suppress zeroes. |
This creates a Vect object with the following properties:
- name = "none"
- compression = 0 (none)
- type = FR_VECT_2S (INT_2S)
- nData = 0
- nBytes = 0
- data = 0 (null)
- nDim = 0
- No dimension information)
- unitY = ""
Exceptions:
Exception | Description |
None. |
Parameters:
Parameter | Description |
const Vect& vect | Copied vector. |
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
Parameters:
Parameter | Description |
const std::string& name | The name of the data. |
INT_2U type | The data type. |
INT_4U nDim | The number of dimensions. |
const Dimension* dims | A pointer to 'nDim' Dimension objects containing information about the dimensions for this data. |
const ByteOrder byte_order | Byte order of the data. Default is BIGENDIAN. |
const void* data | A pointer to the data. Default: 0 |
const std::string& unitY | Units for the data. Default: "" |
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
Parameters:
Parameter | Description |
const std::string& name | The name of the data. |
INT_2U type | The data type. |
INT_4U nDim | The number of dimensions. |
const Dimension* dims | A pointer to 'nDim' Dimension objects containing information about the dimensions for this data. |
const ByteOrder byte_order | Byte order of the data. Default is BIGENDIAN. |
const void* data | A pointer to the data. Default: 0 |
const std::string& unitY | Units for the data. Default: "" |
bool allocate | Whether to allocate data. Default: true. |
bool owns | Whether to destruct data in the destructor. Default: true. |
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
Parameters:
Parameter | Description |
const std::string& name | The name of the data. |
INT_2U type | The data type. |
INT_4U nDim | The number of dimensions. |
const INT_4U* dims | A pointer to 'nDim' Dimension objects containing information about the dimensions for this data. |
const ByteOrder byte_order | Byte order of the data. Default is BIGENDIAN. |
const void* data | A pointer to the data. Default: 0 |
const std::string& unitY | Units for the data. Default: "" |
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
Parameters:
Parameter | Description |
const std::string& name | The name of the data. |
INT_2U type | The data type. |
INT_4U nDim | The number of dimensions. |
const INT_4U* dims | A pointer to 'nDim' Dimension objects containing information about the dimensions for this data. |
const ByteOrder byte_order | Byte order of the data. Default is BIGENDIAN. |
const void* data | A pointer to the data. Default: 0 |
const std::string& unitY | Units for the data. Default: "" |
bool allocate | Whether to allocate data. Default: true. |
bool owns | Whether to destruct data in the destructor. Default: true. |
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
This creates a Vect object from a pointer to data.
Parameters:
Parameter | Description |
const std::string& name | The name for the data. |
INT_4U nDim | The number of dimensions. |
const Dimension* dims | A pointer to 'nDim' Dimension objects containing information about the dimensions for this data. |
const T* data | A pointer to the data. This will be copied into the Vector. |
const std::string& unitY | Units for the data. |
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
std::bad_alloc | Memory allocation failed. |
This creates a Vect object from a pointer to data.
Parameters:
Parameter | Description |
const std::string& name | The name for the data. |
INT_4U nDim | The number of dimensions. |
const Dimension* dims | A pointer to 'nDim' Dimension objects containing information about the dimensions for this data. |
const T* data | A pointer to the data. This will be copied into the Vector. |
const std::string& unitY | Units for the data. |
bool allocate | Whether to allocate data. Default: true. |
bool owns | Whether to destruct data in the destructor. Default: true. |
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
std::bad_alloc | Memory allocation failed. |
This creates a Vect object from a pointer to data.
Parameters:
Parameter | Description |
const std::string& name | The name for the data. |
INT_4U nDim | The number of dimensions. |
const INT_4U* dims | A pointer to 'nDim' integers containing the sizes for each dimension. |
const T* data | A pointer to the data. This will be copied into the Vector. |
const std::string& unitY | Units for the data. |
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
std::bad_alloc | Memory allocation failed. |
This creates a Vect object from a pointer to data.
Parameters:
Parameter | Description |
const std::string& name | The name for the data. |
INT_4U nDim | The number of dimensions. |
const INT_4U* dims | A pointer to 'nDim' size_tegers containing the sizes for each dimension. |
const T* data | A pointer to the data. This will be copied into the Vector. |
const std::string& unitY | Units for the data. |
bool allocate | Whether to allocate data. Default: true. |
bool owns | Whether to destruct data in the destructor. Default: true. |
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
std::bad_alloc | Memory allocation failed. |
Exceptions:
Exception | Description |
std::bad_alloc |
Exceptions:
Exception | Description |
std::bad_alloc |
Exceptions:
Exception | Description |
std::bad_alloc |
Exceptions:
Exception | Description |
std::bad_alloc |
Exceptions:
Exception | Description |
std::bad_alloc |
Exceptions:
Exception | Description |
std::bad_alloc |
Exceptions:
Exception | Description |
std::bad_alloc |
Exceptions:
Exception | Description |
std::bad_alloc |
Deletes data, if it is owned.
Exceptions:
Exception | Description |
None |
Borrowed from FrameL.c, v3r85
Borrowed from FrameL.c, v3r85
Parameters:
Parameter | Description |
Compression c | Compressions type. |
size_t level | Compressions level. |
Exceptions:
Exception | Description |
None. |
The data must be in an uncompressed state before this is called.
The data must be in an uncompressed state before this is called.
In general, uncompressing follows three steps: 1) Gunzip the data. 2) Fix byte-ordering. 3) Integrate. Depending upon the compression type and byte-ordering differences, not all of these steps are needed.
Return value:
ByteOrder- Endianness of vector's data.
Exceptions:
Exception | Description |
None. | |
None. |
Exceptions:
Exception | Description |
None. |
Return value:
INT_2U- Compression algorithm ID.
Exceptions:
Exception | Description |
None. | |
None. |
Parameters:
Parameter | Description |
bool decompress | Whether to expand compressed data. |
Return value:
void*- Vector data.
Exceptions:
Exception | Description |
None. | |
None. |
Parameters:
Parameter | Description |
bool decompress | Whether to expand compressed data. |
Return value:
const void*- Vector data.
Exceptions:
Exception | Description |
None. | |
None. |
Template specifications
Return value:
Type
Parameters:
Parameter | Description |
size_t index | Which dimension. |
Return value:
Dimension&- Reuqested dimension's info.
Exceptions:
Exception | Description |
std::range_error | |
std::range_error | Bad dimensions index given. |
Parameters:
Parameter | Description |
size_t index | Which dimension. |
Return value:
const Dimension&- Reuqested dimension's info.
Exceptions:
Exception | Description |
std::range_error | |
std::range_error | Bad dimensions index given. |
Return value:
INT_4U- (Compressed) Data size.
Exceptions:
Exception | Description |
None. | |
None. |
Return value:
INT_4U- Number of data points.
Exceptions:
Exception | Description |
None. | |
None. |
Return value:
mNDim- Number of data dimensions.
Exceptions:
Exception | Description |
None. | |
None. |
Return value:
SH- Vector class structure header.
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
Return value:
INT_2U- Vector data type ID.
Exceptions:
Exception | Description |
None. | |
None. |
Parameters:
Parameter | Description |
INT_2U type | Data type ID. |
Return value:
INT_2U- Data size.
Exceptions:
Exception | Description |
None. |
Return value:
const std::string&- Data units.
Exceptions:
Exception | Description |
None. | |
None. |
The data must be in an uncompressed state before this is called.
Parameters:
Parameter | Description |
size_t level | Compression level. |
Return value:
bool- Data is owned or not.
Exceptions:
Exception | Description |
None. | |
None. |
Parameters:
Parameter | Description |
const Vect& vect | The object to compare with. |
Return value:
bool- True if the objects are not equal.
Exceptions:
Exception | Description |
None. | |
None. |
Parameters:
Parameter | Description |
const Vect& vect | Vector with which to concatenate. |
Return value:
const Vect&- This vector.
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
frame_mismatch | Vectors are incompatible. |
Parameters:
Parameter | Description |
const Vect& vect | Vector to be assigned. |
Return value:
const Vect&- This vector.
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
Determines whether two Vect objects are equal. For this comparison, all of the data is compared.
Parameters:
Parameter | Description |
const Vect& v | The object with which to compare. |
Return value:
bool- True if the objects are equal.
Exceptions:
Exception | Description |
None. |
This method creates a dynamically allocated object.*NOTE* This method allocates memory and returns a pointer to it. The user is responsible for freeing this memory.
Parameters:
Parameter | Description |
FrameReaderBase& in | Data source. |
Return value:
Vect*- Newly created vector.
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
read_failure | Data read failure occured. |
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
read_failure | Data read failure occured. |
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
read_failure | Data read failure occured. |
Parameters:
Parameter | Description |
const void* data | Data to be copied to the vector. |
Exceptions:
Exception | Description |
bad alloc | Memory allocation failed. |
Parameters:
Parameter | Description |
const void* data | Data to be copied to the vect. |
bool allocate | Whether to allocate data. Default: true. |
bool owns | Whether to destruct data in the destructor. Default: true. |
Exceptions:
Exception | Description |
bad alloc | Memory allocation failed. |
Exceptions:
Exception | Description |
None. | |
None. |
Exceptions:
Exception | Description |
None. | |
None. |
Parameters:
Parameter | Description |
std::vector | New dimensions. |
Exceptions:
Exception | Description |
None. |
Parameters:
Parameter | Description |
INT_4U nb | New number of data bytes. |
Exceptions:
Exception | Description |
None. |
Parameters:
Parameter | Description |
INT_4U nd | New number of data points. |
Exceptions:
Exception | Description |
None. |
Parameters:
Parameter | Description |
Output& out out | Output data stream. |
Exceptions:
Exception | Description |
write_failure | Data write failure occured. |
It should be a value between 1 and 9 inclusive, and the actual block size used is 100000 x this figure. 9 gives the best compression but takes most memory.
If compression runs into difficulties caused by repetitive data, the library switches from the standard sorting algorithm to a fallback algorithm. The fallback is slower than the standard algorithm by perhaps a factor of three, but always behaves reasonably, no matter how bad the input. The default value of 30 gives reasonable behaviour over a wide range of circumstances.