EZC3D
Parameters.h
Go to the documentation of this file.
1 #ifndef PARAMETERS_H
2 #define PARAMETERS_H
3 
11 #include <Group.h>
12 
17  //---- CONSTRUCTOR ----//
18 public:
22  Parameters();
23 
30  std::fstream &file);
31 
32 protected:
37 
38  //---- STREAM ----//
39 public:
43  void print() const;
44 
50  void write(std::fstream &f, std::streampos &dataStartPosition) const;
51 
52 
53  //---- PARAMETER METADATA ----//
54 protected:
55  // Read the Parameters Header
57  size_t _checksum;
61  size_t _nbParamBlock;
68 
71 public:
76  size_t parametersStart() const;
77 
84  size_t checksum() const;
85 
90  size_t nbParamBlock() const;
91 
99 
100 
101  //---- GROUPS ----//
102 protected:
103  std::vector<ezc3d::ParametersNS::GroupNS::Group> _groups;
104 
105 public:
109  size_t nbGroups() const;
110 
120  size_t groupIdx(const std::string& groupName) const;
121 
131  const ezc3d::ParametersNS::GroupNS::Group& group(size_t idx) const;
132 
144 
152  const ezc3d::ParametersNS::GroupNS::Group& group(const std::string& groupName) const;
153 
161  ezc3d::ParametersNS::GroupNS::Group& group_nonConst(const std::string& groupName);
162 
169  void group(const ezc3d::ParametersNS::GroupNS::Group& group);
170 
175  const std::vector<ezc3d::ParametersNS::GroupNS::Group>& groups() const;
176 };
177 
178 #endif
size_t parametersStart() const
Get the byte in the file where the data starts.
Definition: Parameters.cpp:279
size_t nbGroups() const
Get the number of groups.
Definition: Parameters.cpp:299
Group holder of C3D parameters.
Definition: Parameters.h:16
Declaration of Group class.
size_t nbParamBlock() const
Get the number of 256-bytes the parameters need in the file.
Definition: Parameters.cpp:289
PROCESSOR_TYPE
The type of processor used to store the data.
Definition: ezc3d.h:85
Group of parameter of a C3D file.
Definition: Group.h:16
PROCESSOR_TYPE processorType() const
Get the processor type the file was writen on.
Definition: Parameters.cpp:294
const ezc3d::ParametersNS::GroupNS::Group & group(size_t idx) const
Get a particular group of index idx from the group holder.
Definition: Parameters.cpp:312
Namespace ezc3d.
Definition: ezc3d.h:68
std::vector< ezc3d::ParametersNS::GroupNS::Group > _groups
Holder for the group of parameters.
Definition: Parameters.h:103
ezc3d::ParametersNS::GroupNS::Group & group_nonConst(size_t idx)
Get a particular group of index idx from the group holder in order to be modified by the caller...
Definition: Parameters.cpp:324
Main class for C3D holder.
Definition: ezc3d.h:154
const std::vector< ezc3d::ParametersNS::GroupNS::Group > & groups() const
Get all groups the group holder with read-only access.
Definition: Parameters.cpp:361
void write(std::fstream &f, std::streampos &dataStartPosition) const
Write the groups to an opened file by calling the write method of all the groups. ...
Definition: Parameters.cpp:246
void setMandatoryParameters()
Add all required parameter for a c3d to be valid.
Definition: Parameters.cpp:82
Parameters()
Create a default group holder with minimal groups to have a valid c3d.
Definition: Parameters.cpp:13
size_t checksum() const
Get the checksum of the parameters.
Definition: Parameters.cpp:284
void print() const
Print the groups by calling the print method of all the groups.
Definition: Parameters.cpp:231
size_t groupIdx(const std::string &groupName) const
Get the index of a group in the group holder.
Definition: Parameters.cpp:304