A Channel contains several data Sections representing observations of the same physical quantity.
More...
#include <channel.h>
List of all members.
Public Member Functions |
| Channel (void) |
| Default constructor.
|
| Channel (const Section &c_Section) |
| Constructor.
|
| Channel (const std::vector< Section > &SectionList) |
| Constructor.
|
| Channel (std::size_t c_n_sections, std::size_t section_size=0) |
| Constructor.
|
| ~Channel () |
| Destructor.
|
Section & | operator[] (std::size_t at_) |
| Unchecked access to a section (read and write)
|
const Section & | operator[] (std::size_t at_) const |
| Unchecked access to a section (read-only)
|
const std::string & | GetChannelName () const |
| Retrieves the channel name.
|
const std::string & | GetYUnits () const |
| Retrieves the y units string.
|
size_t | size () const |
| Retrieves the size of the section array.
|
const Section & | at (std::size_t at_) const |
| Range-checked access to a section (read-only).
|
Section & | at (std::size_t at_) |
| Range-checked access to a section (read and write).
|
const std::vector< Section > & | get () const |
| Low-level access to the section array (read-only).
|
std::vector< Section > & | get () |
| Low-level access to the section array (read and write).
|
void | SetChannelName (const std::string &value) |
| Sets the channel name.
|
void | SetYUnits (const std::string &value) |
| Sets the y units string.
|
void | InsertSection (const Section &c_Section, std::size_t pos) |
| Inserts a section at the given position, overwriting anything that's currently stored at that position.
|
void | resize (std::size_t newSize) |
| Resize the section array.
|
void | reserve (std::size_t resSize) |
| Reserve memory for a number of sections.
|
Detailed Description
A Channel contains several data Sections representing observations of the same physical quantity.
Constructor & Destructor Documentation
Channel::Channel |
( |
const Section & |
c_Section | ) |
[explicit] |
Constructor.
- Parameters:
-
c_Section | A single section from which to construct the channel |
Channel::Channel |
( |
const std::vector< Section > & |
SectionList | ) |
[explicit] |
Constructor.
- Parameters:
-
SectionList | A vector of Sections from which to construct the channel |
Channel::Channel |
( |
std::size_t |
c_n_sections, |
|
|
std::size_t |
section_size = 0 |
|
) |
| [explicit] |
Constructor.
Setting the number of sections at construction time will avoid unnecessary memory re-allocations.
- Parameters:
-
c_n_sections | The number of sections. |
section_size | Initial section size. Will serve additional re-alocations if known at construction time. |
Member Function Documentation
const Section& Channel::at |
( |
std::size_t |
at_ | ) |
const |
Range-checked access to a section (read-only).
Will throw std::out_of_range if out of range.
- Parameters:
-
at_ | The index of the section. |
- Returns:
- The section at index at_.
Section& Channel::at |
( |
std::size_t |
at_ | ) |
|
Range-checked access to a section (read and write).
Will throw std::out_of_range if out of range.
- Parameters:
-
at_ | The index of the section. |
- Returns:
- The section at index at_.
const std::vector< Section >& Channel::get |
( |
| ) |
const [inline] |
Low-level access to the section array (read-only).
- Returns:
- The vector containing the sections.
std::vector< Section >& Channel::get |
( |
| ) |
[inline] |
Low-level access to the section array (read and write).
- Returns:
- The vector containing the sections.
const std::string& Channel::GetChannelName |
( |
| ) |
const [inline] |
Retrieves the channel name.
- Returns:
- The channel name.
const std::string& Channel::GetYUnits |
( |
| ) |
const [inline] |
Retrieves the y units string.
- Returns:
- The y units string.
void Channel::InsertSection |
( |
const Section & |
c_Section, |
|
|
std::size_t |
pos |
|
) |
| |
Inserts a section at the given position, overwriting anything that's currently stored at that position.
Meant to be used after constructing with Channel(const unsigned int& c_n_sections}. The section array size has to be larger than pos because it won't be resized. Will throw std::out_of_range if out of range.
- Parameters:
-
c_Section | The section to be inserted. |
pos | The position at which to insert the section. |
Section& Channel::operator[] |
( |
std::size_t |
at_ | ) |
[inline] |
Unchecked access to a section (read and write)
Use at() for range-checked access.
- Parameters:
-
- Returns:
- The section at index at_.
const Section& Channel::operator[] |
( |
std::size_t |
at_ | ) |
const [inline] |
Unchecked access to a section (read-only)
Use at() for range-checked access.
- Parameters:
-
- Returns:
- The section at index at_.
void Channel::reserve |
( |
std::size_t |
resSize | ) |
|
Reserve memory for a number of sections.
This will avoid unnecessary memory re-allocations.
- Parameters:
-
resSize | The number of sections to reserve memory for. |
void Channel::resize |
( |
std::size_t |
newSize | ) |
|
Resize the section array.
- Parameters:
-
newSize | The new number of sections. |
void Channel::SetChannelName |
( |
const std::string & |
value | ) |
[inline] |
Sets the channel name.
- Parameters:
-
void Channel::SetYUnits |
( |
const std::string & |
value | ) |
[inline] |
Sets the y units string.
- Parameters:
-
value | The new y units string. |
size_t Channel::size |
( |
| ) |
const [inline] |
Retrieves the size of the section array.
- Returns:
- The size of the section array.
The documentation for this class was generated from the following file: