EZC3D
Public Member Functions | Protected Attributes | List of all members
ezc3d::DataNS::AnalogsNS::SubFrame Class Reference

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::Channelchannel (size_t idx) const
 Get a particular analog channel of index idx from the analogous data. More...
 
ezc3d::DataNS::AnalogsNS::Channelchannel_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.
 

Detailed Description

Subframe for the analogous data.

Definition at line 16 of file Subframe.h.

Member Function Documentation

◆ channel() [1/2]

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.

Parameters
idxIndex of the analog channel
Returns
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.

◆ channel() [2/2]

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.

Parameters
channelthe channel to add
idxthe 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.

◆ channel_nonConst()

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.

Parameters
idxIndex of the analog channel
Returns
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.

◆ channels()

const std::vector< ezc3d::DataNS::AnalogsNS::Channel > & ezc3d::DataNS::AnalogsNS::SubFrame::channels ( ) const

Get all the analog channels from the analogous data.

Returns
The analog channels

Definition at line 76 of file Subframe.cpp.

◆ isempty()

bool ezc3d::DataNS::AnalogsNS::SubFrame::isempty ( ) const

Return if the subframe is empty.

Returns
if the subframe is empty

Definition at line 81 of file Subframe.cpp.

◆ nbChannels() [1/2]

size_t ezc3d::DataNS::AnalogsNS::SubFrame::nbChannels ( ) const

Get the number of analog channels.

Returns
The number of channels

Definition at line 31 of file Subframe.cpp.

◆ nbChannels() [2/2]

void ezc3d::DataNS::AnalogsNS::SubFrame::nbChannels ( size_t  nChannels)

Resize the number of channels. Warning, this function drops data if channels are downsized.

Parameters
nChannelsNumber of channels in the subframe

Definition at line 36 of file Subframe.cpp.

◆ print()

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.

◆ write()

void ezc3d::DataNS::AnalogsNS::SubFrame::write ( std::fstream &  f) const

Write the subframe to an opened file.

Parameters
fAlready 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.


The documentation for this class was generated from the following files: