Skip to content

Commit

Permalink
Linted some code
Browse files Browse the repository at this point in the history
  • Loading branch information
pariterre committed Oct 11, 2019
1 parent 6319704 commit ee1655f
Show file tree
Hide file tree
Showing 14 changed files with 215 additions and 105 deletions.
16 changes: 11 additions & 5 deletions include/Analogs.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class EZC3D_API ezc3d::DataNS::AnalogsNS::Analogs{
///
/// Write all the subframes to a file by calling sequentially the write method of each subframe
///
void write(std::fstream &f) const;
void write(
std::fstream &f) const;


//---- SUBFRAME ----//
Expand All @@ -55,7 +56,8 @@ class EZC3D_API ezc3d::DataNS::AnalogsNS::Analogs{
/// \brief Resize the number of subframes. Warning, this function drops data if subframes is downsized
/// \param nbSubframes The number of subframes to be in the holder
///
void nbSubframes(size_t nbSubframes);
void nbSubframes(
size_t nbSubframes);

///
/// \brief Get a particular subframe of index idx from the analogous data set
Expand All @@ -66,7 +68,8 @@ class EZC3D_API ezc3d::DataNS::AnalogsNS::Analogs{
///
/// Throw a std::out_of_range exception if idx is larger than the number of subframes
///
const ezc3d::DataNS::AnalogsNS::SubFrame& subframe(size_t idx) const;
const ezc3d::DataNS::AnalogsNS::SubFrame& subframe(
size_t idx) const;

///
/// \brief Get a particular subframe of index idx from the analogous data set in order to be modified by the caller
Expand All @@ -78,7 +81,8 @@ class EZC3D_API ezc3d::DataNS::AnalogsNS::Analogs{
///
/// Throw a std::out_of_range exception if idx is larger than the number of subframes
///
ezc3d::DataNS::AnalogsNS::SubFrame& subframe(size_t idx);
ezc3d::DataNS::AnalogsNS::SubFrame& subframe(
size_t idx);

///
/// \brief Add/replace a subframe to the analogous data set
Expand All @@ -92,7 +96,9 @@ class EZC3D_API ezc3d::DataNS::AnalogsNS::Analogs{
/// 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.
///
void subframe(const ezc3d::DataNS::AnalogsNS::SubFrame& subframe, size_t idx = SIZE_MAX);
void subframe(
const ezc3d::DataNS::AnalogsNS::SubFrame& subframe,
size_t idx = SIZE_MAX);

///
/// \brief Get all the subframes from the analogous data set
Expand Down
9 changes: 6 additions & 3 deletions include/Channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class EZC3D_API ezc3d::DataNS::AnalogsNS::Channel{
/// \brief Copy an analog channel
/// \param channel The channel to copy
///
Channel(const ezc3d::DataNS::AnalogsNS::Channel &channel);
Channel(
const ezc3d::DataNS::AnalogsNS::Channel &channel);


//---- STREAM ----//
Expand All @@ -44,7 +45,8 @@ class EZC3D_API ezc3d::DataNS::AnalogsNS::Channel{
///
/// Write the value of the analog data to a file
///
void write(std::fstream &f) const;
void write(
std::fstream &f) const;


//---- DATA ----//
Expand All @@ -61,7 +63,8 @@ class EZC3D_API ezc3d::DataNS::AnalogsNS::Channel{
/// \brief Set the value of the analog data
/// \param value The value of the analog data
///
void data(float value);
void data(
float value);

///
/// \brief Return if the channel is empty
Expand Down
18 changes: 12 additions & 6 deletions include/Data.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ class EZC3D_API ezc3d::DataNS::Data{
/// \param c3d Reference to the c3d to copy the data in
/// \param file File to copy the data from
///
Data(ezc3d::c3d &c3d,
std::fstream &file);
Data(
ezc3d::c3d &c3d,
std::fstream &file);


//---- STREAM ----//
Expand All @@ -48,7 +49,8 @@ class EZC3D_API ezc3d::DataNS::Data{
///
/// Write all the data to a file by calling sequentially all the write method for all the frames
///
void write(std::fstream &f) const;
void write(
std::fstream &f) const;


//---- FRAME ----//
Expand All @@ -70,7 +72,8 @@ class EZC3D_API ezc3d::DataNS::Data{
///
/// Throw a std::out_of_range exception if idx is larger than the number of frames
///
const ezc3d::DataNS::Frame& frame(size_t idx) const;
const ezc3d::DataNS::Frame& frame(
size_t idx) const;

///
/// \brief Get the frame of index idx in order to be modified by the caller
Expand All @@ -83,7 +86,8 @@ class EZC3D_API ezc3d::DataNS::Data{
/// Throw a std::out_of_range exception if idx is larger than the number of frames
///
///
ezc3d::DataNS::Frame& frame(size_t idx);
ezc3d::DataNS::Frame& frame(
size_t idx);

///
/// \brief Add/replace a frame to the data set
Expand All @@ -97,7 +101,9 @@ class EZC3D_API ezc3d::DataNS::Data{
/// If idx is outside the data set, it resize the data set accordingly and add the frame where it belongs
/// but leaves the other created frames empty.
///
void frame(const ezc3d::DataNS::Frame& frame, size_t idx = SIZE_MAX);
void frame(
const ezc3d::DataNS::Frame& frame,
size_t idx = SIZE_MAX);

///
/// \brief Get all the frames from the data set
Expand Down
16 changes: 11 additions & 5 deletions include/Frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class EZC3D_API ezc3d::DataNS::Frame{
///
/// Write the frame to a file by calling sequentially the write method for points and analogs
///
void write(std::fstream &f) const;
void write(
std::fstream &f) const;


//---- POINTS ----//
Expand Down Expand Up @@ -88,26 +89,31 @@ class EZC3D_API ezc3d::DataNS::Frame{
/// \brief Add a frame by copying a sent frame
/// \param frame The frame to copy
///
void add(const ezc3d::DataNS::Frame &frame);
void add(
const ezc3d::DataNS::Frame &frame);

///
/// \brief Add points to a frame
/// \param points The 3D points to add
///
void add(const ezc3d::DataNS::Points3dNS::Points &points);
void add(
const ezc3d::DataNS::Points3dNS::Points &points);

///
/// \brief Add analogs to a frame
/// \param analogs The analogous data to add
///
void add(const ezc3d::DataNS::AnalogsNS::Analogs &analogs);
void add(
const ezc3d::DataNS::AnalogsNS::Analogs &analogs);

///
/// \brief Add points and analogs to a frame
/// \param points The 3D points to add
/// \param analogs The analogous data to add
///
void add(const ezc3d::DataNS::Points3dNS::Points &points, const ezc3d::DataNS::AnalogsNS::Analogs &analogs);
void add(
const ezc3d::DataNS::Points3dNS::Points &points,
const ezc3d::DataNS::AnalogsNS::Analogs &analogs);

///
/// \brief Return if the frame is empty
Expand Down
28 changes: 17 additions & 11 deletions include/Group.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class EZC3D_API ezc3d::ParametersNS::GroupNS::Group{
/// \param name The name of the group of parameter
/// \param description The description of the group of parameter
///
Group(const std::string &name = "", const std::string &description = "");
Group(
const std::string &name = "",
const std::string &description = "");


//---- STREAM ----//
Expand Down Expand Up @@ -70,7 +72,7 @@ class EZC3D_API ezc3d::ParametersNS::GroupNS::Group{
/// \brief Set the name of the group
/// \param name The name of the group
///
void name(const std::string name);
void name(const std::string& name);

///
/// \brief Get the description of the group
Expand All @@ -82,7 +84,7 @@ class EZC3D_API ezc3d::ParametersNS::GroupNS::Group{
/// \brief Set the description of the group
/// \param description The description of the group
///
void description(const std::string description);
void description(const std::string& description);

///
/// \brief Get the locking status of the group
Expand Down Expand Up @@ -120,7 +122,7 @@ class EZC3D_API ezc3d::ParametersNS::GroupNS::Group{
///
/// Throw a std::invalid_argument if parameterName is not found
///
size_t parameterIdx(std::string parameterName) const;
size_t parameterIdx(const std::string& parameterName) const;

///
/// \brief Get a particular parameter of index idx from the group
Expand Down Expand Up @@ -152,7 +154,8 @@ class EZC3D_API ezc3d::ParametersNS::GroupNS::Group{
///
/// Throw a std::invalid_argument if parameterName is not found
///
const ezc3d::ParametersNS::GroupNS::Parameter& parameter(std::string parameterName) const;
const ezc3d::ParametersNS::GroupNS::Parameter& parameter(
const std::string& parameterName) const;

///
/// \brief Get a particular parameter with the name parameterName from the group in the form of a non-const reference.
Expand All @@ -164,7 +167,8 @@ class EZC3D_API ezc3d::ParametersNS::GroupNS::Group{
///
/// Throw a std::invalid_argument if parameterName is not found
///
ezc3d::ParametersNS::GroupNS::Parameter& parameter(std::string parameterName);
ezc3d::ParametersNS::GroupNS::Parameter& parameter(
const std::string& parameterName);

///
/// \brief Add a parameter to the group from a C3D file
Expand All @@ -174,18 +178,20 @@ class EZC3D_API ezc3d::ParametersNS::GroupNS::Group{
/// \param nbCharInName The number of character of the parameter name
/// \return
///
int parameter(c3d &c3d,
const Parameters &params,
std::fstream &file,
int nbCharInName);
int parameter(
c3d &c3d,
const Parameters &params,
std::fstream &file,
int nbCharInName);

///
/// \brief Add/replace a parameter to the group
/// \param parameter The parameter to add
///
/// If the parameter sent does not exist in the group, it is appended. Otherwise it is replaced
///
void parameter(const ezc3d::ParametersNS::GroupNS::Parameter& parameter);
void parameter(
const ezc3d::ParametersNS::GroupNS::Parameter& parameter);

///
/// \brief Get all the parameter from the group
Expand Down
42 changes: 28 additions & 14 deletions include/Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ class EZC3D_API ezc3d::Header{
/// \param c3d C3D reference to copy the data in
/// \param file Already opened fstream file with read access
///
Header(c3d &c3d,
std::fstream &file);
Header(
c3d &c3d,
std::fstream &file);


//---- STREAM ----//
Expand All @@ -42,15 +43,18 @@ class EZC3D_API ezc3d::Header{
/// \param f Already opened fstream file with write access
/// \param dataStartPosition Returns the byte where to put the data start parameter
///
void write(std::fstream &f, std::streampos &dataStartPosition) const;
void write(
std::fstream &f,
std::streampos &dataStartPosition) const;

///
/// \brief Read and store a header from an opened C3D file
/// \param c3d C3D reference to copy the data in
/// \param file The file stream already opened with read access
///
void read(c3d &c3d,
std::fstream &file);
void read(
c3d &c3d,
std::fstream &file);


//---- HEADER ----//
Expand Down Expand Up @@ -82,7 +86,9 @@ class EZC3D_API ezc3d::Header{
/// \param file opened file stream to be read
/// \return The processor type as specified in the c3d file (83-Intel, 84-DEC, 85-MIPS)
///
PROCESSOR_TYPE readProcessorType(c3d &c3d, std::fstream &file);
PROCESSOR_TYPE readProcessorType(
c3d &c3d,
std::fstream &file);

protected:
size_t _checksum; ///< Byte 1.2
Expand Down Expand Up @@ -132,7 +138,8 @@ class EZC3D_API ezc3d::Header{
/// \brief Set the number of analogs
/// \param nbOfAnalogs The number of analogs
///
void nbAnalogs(size_t nbOfAnalogs);
void nbAnalogs(
size_t nbOfAnalogs);

///
/// \brief Get the number of recorded analogs
Expand Down Expand Up @@ -169,7 +176,8 @@ class EZC3D_API ezc3d::Header{
/// \brief Set the first frame
/// \param frame
///
void firstFrame(size_t frame);
void firstFrame(
size_t frame);

///
/// \brief Get the last frame
Expand All @@ -181,7 +189,8 @@ class EZC3D_API ezc3d::Header{
/// \brief Set the last frame
/// \param frame
///
void lastFrame(size_t frame);
void lastFrame(
size_t frame);

protected:
size_t _nbMaxInterpGap; ///< Byte 6
Expand Down Expand Up @@ -237,7 +246,8 @@ class EZC3D_API ezc3d::Header{
/// \brief Set the number of analog by frame
/// \param nbOfAnalogsByFrame The number of analog by frame
///
void nbAnalogByFrame(size_t nbOfAnalogsByFrame);
void nbAnalogByFrame(
size_t nbOfAnalogsByFrame);

protected:
float _frameRate; ///< Byte 11-12
Expand All @@ -255,7 +265,8 @@ class EZC3D_API ezc3d::Header{
/// \brief Set the points frame rate in Hz
/// \param pointFrameRate The points frame rate in Hz
///
void frameRate(float pointFrameRate);
void frameRate(
float pointFrameRate);

protected:
int _emptyBlock1; ///< Byte 13-147
Expand Down Expand Up @@ -373,7 +384,8 @@ class EZC3D_API ezc3d::Header{
///
/// Throw a std::out_of_range exception if idx is larger than the number of events
///
float eventsTime(size_t idx) const;
float eventsTime(
size_t idx) const;

///
/// \brief Get the display flags
Expand All @@ -394,7 +406,8 @@ class EZC3D_API ezc3d::Header{
///
/// Throw a std::out_of_range exception if idx is larger than the number of events
///
size_t eventsDisplay(size_t idx) const;
size_t eventsDisplay(
size_t idx) const;

///
/// \brief Get the event labels
Expand All @@ -409,7 +422,8 @@ class EZC3D_API ezc3d::Header{
///
/// Throw a std::out_of_range exception if idx is larger than the number of events
///
const std::string& eventsLabel(size_t idx) const;
const std::string& eventsLabel(
size_t idx) const;

};

Expand Down
Loading

0 comments on commit ee1655f

Please sign in to comment.