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

Analog holder for C3D analogous data. More...

#include <Analogs.h>

Public Member Functions

 Analogs ()
 Create an empty holder for the analogous data.
 
void print () const
 Print the subframes. More...
 
void write (std::fstream &f) const
 Write the subframes to an opened file. More...
 
size_t nbSubframes () const
 Get the number of subframes. More...
 
void nbSubframes (size_t nbSubframes)
 Resize the number of subframes. Warning, this function drops data if subframes is downsized. More...
 
const ezc3d::DataNS::AnalogsNS::SubFramesubframe (size_t idx) const
 Get a particular subframe of index idx from the analogous data set. More...
 
ezc3d::DataNS::AnalogsNS::SubFramesubframe_nonConst (size_t idx)
 Get a particular subframe of index idx from the analogous data set in order to be modified by the caller. More...
 
void subframe (const ezc3d::DataNS::AnalogsNS::SubFrame &subframe, size_t idx=SIZE_MAX)
 Add/replace a subframe to the analogous data set. More...
 
const std::vector< ezc3d::DataNS::AnalogsNS::SubFrame > & subframes () const
 Get all the subframes from the analogous data set. More...
 
bool isempty () const
 Return if the analogs are empty. More...
 

Protected Attributes

std::vector< ezc3d::DataNS::AnalogsNS::SubFrame_subframe
 Holder for the subframes.
 

Detailed Description

Analog holder for C3D analogous data.

Definition at line 16 of file Analogs.h.

Member Function Documentation

◆ isempty()

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

Return if the analogs are empty.

Returns
if the analogs are empty

Definition at line 83 of file Analogs.cpp.

◆ nbSubframes() [1/2]

size_t ezc3d::DataNS::AnalogsNS::Analogs::nbSubframes ( ) const

Get the number of subframes.

Returns
The number of subframes

Definition at line 33 of file Analogs.cpp.

◆ nbSubframes() [2/2]

void ezc3d::DataNS::AnalogsNS::Analogs::nbSubframes ( size_t  nbSubframes)

Resize the number of subframes. Warning, this function drops data if subframes is downsized.

Parameters
nbSubframesThe number of subframes to be in the holder

Definition at line 38 of file Analogs.cpp.

◆ print()

void ezc3d::DataNS::AnalogsNS::Analogs::print ( ) const

Print the subframes.

Print the subframes to the console by calling sequentially the print method of each subframes

Definition at line 17 of file Analogs.cpp.

◆ subframe() [1/2]

const ezc3d::DataNS::AnalogsNS::SubFrame & ezc3d::DataNS::AnalogsNS::Analogs::subframe ( size_t  idx) const

Get a particular subframe of index idx from the analogous data set.

Parameters
idxThe index of the subframe
Returns
The Subframe

Get a particular subframe of index idx from the analogous data set.

Throw a std::out_of_range exception if idx is larger than the number of subframes

Definition at line 43 of file Analogs.cpp.

◆ subframe() [2/2]

void ezc3d::DataNS::AnalogsNS::Analogs::subframe ( const ezc3d::DataNS::AnalogsNS::SubFrame subframe,
size_t  idx = SIZE_MAX 
)

Add/replace a subframe to the analogous data set.

Parameters
subframeThe subframe to add
idxThe index of the subframe in the analogous data set

Add or replace a subframe to the analogous data set.

If no idx is sent, then the subframe is appended to the analogous data set. If the idx correspond to a pre-existing subframe, it replaces it. If idx is larger than the number of subframes, it resize the analogous data set accordingly and add the subframe where it belongs but leaves the other created subframes empty.

Definition at line 67 of file Analogs.cpp.

◆ subframe_nonConst()

ezc3d::DataNS::AnalogsNS::SubFrame & ezc3d::DataNS::AnalogsNS::Analogs::subframe_nonConst ( size_t  idx)

Get a particular subframe of index idx from the analogous data set in order to be modified by the caller.

Parameters
idxThe index of the subframe
Returns
A non-const reference to the subframe

Get a particular subframe of index idx from the analogous data in the form of a non-const reference. The user can thereafter modify these points at will, but with the caution it requires.

Throw a std::out_of_range exception if idx is larger than the number of subframes

Definition at line 55 of file Analogs.cpp.

◆ subframes()

const std::vector< ezc3d::DataNS::AnalogsNS::SubFrame > & ezc3d::DataNS::AnalogsNS::Analogs::subframes ( ) const

Get all the subframes from the analogous data set.

Returns
The subframes

Definition at line 78 of file Analogs.cpp.

◆ write()

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

Write the subframes to an opened file.

Parameters
fAlready opened fstream file with write access

Write all the subframes to a file by calling sequentially the write method of each subframe

Definition at line 26 of file Analogs.cpp.


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