EZC3D
|
Subframe for the analogous data. More...
#include <Subframe.h>
Public Member Functions | |
SubFrame () | |
Create an empty subframe for analogous data. | |
void | print () const |
Print the subframe. More... | |
void | write (std::fstream &f) const |
Write the subframe to an opened file. More... | |
size_t | nbChannels () const |
Get the number of analog channels. More... | |
void | nbChannels (size_t nChannels) |
Resize the number of channels. Warning, this function drops data if channels are downsized. More... | |
const ezc3d::DataNS::AnalogsNS::Channel & | channel (size_t idx) const |
Get a particular analog channel of index idx from the analogous data. More... | |
ezc3d::DataNS::AnalogsNS::Channel & | channel_nonConst (size_t idx) |
Get a particular analog channel of index idx from the analogous data with write access. More... | |
void | channel (const ezc3d::DataNS::AnalogsNS::Channel &channel, size_t idx=SIZE_MAX) |
Add/replace a channel to the analog subframe data set. More... | |
const std::vector< ezc3d::DataNS::AnalogsNS::Channel > & | channels () const |
Get all the analog channels from the analogous data. More... | |
bool | isempty () const |
Return if the subframe is empty. More... | |
Protected Attributes | |
std::vector< ezc3d::DataNS::AnalogsNS::Channel > | _channels |
Holder for the channels. | |
Subframe for the analogous data.
Definition at line 16 of file Subframe.h.
const ezc3d::DataNS::AnalogsNS::Channel & ezc3d::DataNS::AnalogsNS::SubFrame::channel | ( | size_t | idx | ) | const |
Get a particular analog channel of index idx from the analogous data.
idx | Index of the analog channel |
Get a particular analog channel of index idx from the analogous data.
Throw a std::out_of_range exception if idx is larger than the number of channels
Definition at line 41 of file Subframe.cpp.
void ezc3d::DataNS::AnalogsNS::SubFrame::channel | ( | const ezc3d::DataNS::AnalogsNS::Channel & | channel, |
size_t | idx = SIZE_MAX |
||
) |
Add/replace a channel to the analog subframe data set.
channel | the channel to add |
idx | the index of the channel in the subframe data set |
Add or replace a particular channel to the subframe data set.
If no idx is sent, then the channel is appended to the points data set. If the idx correspond to a pre-existing channel, it replaces it. If idx is larger than the number of channels, it resize the subframe accordingly and add the channel where it belongs but leaves the other created channels empty.
Definition at line 65 of file Subframe.cpp.
ezc3d::DataNS::AnalogsNS::Channel & ezc3d::DataNS::AnalogsNS::SubFrame::channel_nonConst | ( | size_t | idx | ) |
Get a particular analog channel of index idx from the analogous data with write access.
idx | Index of the analog channel |
Get a particular analog channel of index idx from the analogous in the form of a non-const reference. The user can thereafter modify this analog channel at will, but with the caution it requires.
Throw a std::out_of_range exception if idx is larger than the number of channels
Definition at line 53 of file Subframe.cpp.
const std::vector< ezc3d::DataNS::AnalogsNS::Channel > & ezc3d::DataNS::AnalogsNS::SubFrame::channels | ( | ) | const |
Get all the analog channels from the analogous data.
Definition at line 76 of file Subframe.cpp.
bool ezc3d::DataNS::AnalogsNS::SubFrame::isempty | ( | ) | const |
Return if the subframe is empty.
Definition at line 81 of file Subframe.cpp.
size_t ezc3d::DataNS::AnalogsNS::SubFrame::nbChannels | ( | ) | const |
Get the number of analog channels.
Definition at line 31 of file Subframe.cpp.
void ezc3d::DataNS::AnalogsNS::SubFrame::nbChannels | ( | size_t | nChannels | ) |
Resize the number of channels. Warning, this function drops data if channels are downsized.
nChannels | Number of channels in the subframe |
Definition at line 36 of file Subframe.cpp.
void ezc3d::DataNS::AnalogsNS::SubFrame::print | ( | ) | const |
Print the subframe.
Print the subframe to the console by calling sequentially the print method of all of the analog channels
Definition at line 17 of file Subframe.cpp.
void ezc3d::DataNS::AnalogsNS::SubFrame::write | ( | std::fstream & | f | ) | const |
Write the subframe to an opened file.
f | Already opened fstream file with write access |
Write the subframe to a file by calling sequentially the write method of all of the analog channels
Definition at line 24 of file Subframe.cpp.