EZC3D
Group.h
Go to the documentation of this file.
1 #ifndef GROUP_H
2 #define GROUP_H
3 
11 #include <Parameter.h>
12 
17  //---- CONSTRUCTOR ----//
18 public:
24  Group(const std::string &name = "", const std::string &description = "");
25 
26 
27  //---- STREAM ----//
28 public:
32  void print() const;
33 
40  void write(std::fstream &f, int groupIdx, std::streampos &dataStartPosition) const;
41 
50  int read(ezc3d::c3d &c3d,
51  const Parameters &params,
52  std::fstream &file,
53  int nbCharInName);
54 
55 
56  //---- METADATA ----//
57 protected:
58  std::string _name;
59  std::string _description;
60  bool _isLocked;
61 
62 public:
67  const std::string& name() const;
68 
73  void name(const std::string name);
74 
79  const std::string& description() const;
80 
85  void description(const std::string description);
86 
91  bool isLocked() const;
92 
96  void lock();
97 
101  void unlock();
102 
103 
104  //---- PARAMETERS ----/////
105 protected:
106  std::vector<ezc3d::ParametersNS::GroupNS::Parameter> _parameters;
107 
108 public:
112  size_t nbParameters() const;
113 
123  size_t parameterIdx(std::string parameterName) const;
124 
134  const ezc3d::ParametersNS::GroupNS::Parameter& parameter(size_t idx) const;
135 
147 
155  const ezc3d::ParametersNS::GroupNS::Parameter& parameter(std::string parameterName) const;
156 
168 
177  int parameter(c3d &c3d,
178  const Parameters &params,
179  std::fstream &file,
180  int nbCharInName);
181 
188  void parameter(const ezc3d::ParametersNS::GroupNS::Parameter& parameter);
189 
194  const std::vector<ezc3d::ParametersNS::GroupNS::Parameter>& parameters() const;
195 
196 };
197 
198 #endif
Group holder of C3D parameters.
Definition: Parameters.h:16
void unlock()
Set the locking status of the group to false.
Definition: Group.cpp:124
size_t nbParameters() const
Get the number of parameters.
Definition: Group.cpp:129
Group of parameter of a C3D file.
Definition: Group.h:16
size_t parameterIdx(std::string parameterName) const
Get the index of a parameter in the group.
Definition: Group.cpp:134
Declaration of Parameter class.
std::vector< ezc3d::ParametersNS::GroupNS::Parameter > _parameters
Holder for the parameters of the group.
Definition: Group.h:106
const std::string & description() const
Get the description of the group.
Definition: Group.cpp:105
Namespace ezc3d.
Definition: ezc3d.h:68
void print() const
Print the group by calling the print method of all the parameters.
Definition: Group.cpp:21
std::string _name
The name of the group.
Definition: Group.h:58
const ezc3d::ParametersNS::GroupNS::Parameter & parameter(size_t idx) const
Get a particular parameter of index idx from the group.
Definition: Group.cpp:143
void write(std::fstream &f, int groupIdx, std::streampos &dataStartPosition) const
Write the group to an opened file by calling the write method of all the parameters.
Definition: Group.cpp:33
Main class for C3D holder.
Definition: ezc3d.h:154
const std::string & name() const
Get the name of the group.
Definition: Group.cpp:95
const std::vector< ezc3d::ParametersNS::GroupNS::Parameter > & parameters() const
Get all the parameter from the group.
Definition: Group.cpp:202
Group(const std::string &name="", const std::string &description="")
Create an empty group of parameter.
Definition: Group.cpp:13
std::string _description
The description of the group.
Definition: Group.h:59
bool isLocked() const
Get the locking status of the group.
Definition: Group.cpp:115
bool _isLocked
The lock status of the group.
Definition: Group.h:60
ezc3d::ParametersNS::GroupNS::Parameter & parameter_nonConst(size_t idx)
Get a particular parameter of index idx from the group in order to be modified by the caller...
Definition: Group.cpp:155
Parameter of a C3D file.
Definition: Parameter.h:16
int read(ezc3d::c3d &c3d, const Parameters &params, std::fstream &file, int nbCharInName)
Read and store a group of parameter from an opened C3D file.
Definition: Group.cpp:65
void lock()
Set the locking status of the group to true.
Definition: Group.cpp:120