comparison src/Support/StrobeList.h @ 8:fcbf85ce59fb

- Lots of changes to make cpplint happy. It still complains about header guards, but that's pretty much it now.
author tomwalters
date Thu, 18 Feb 2010 21:12:41 +0000
parents 3c782dec2fc0
children 3078854c634a
comparison
equal deleted inserted replaced
7:1a1988ec40e7 8:fcbf85ce59fb
26 */ 26 */
27 27
28 #ifndef _AIMC_SUPPORT_STROBE_LIST_H_ 28 #ifndef _AIMC_SUPPORT_STROBE_LIST_H_
29 #define _AIMC_SUPPORT_STROBE_LIST_H_ 29 #define _AIMC_SUPPORT_STROBE_LIST_H_
30 30
31 #include <math.h>
31 #include <deque> 32 #include <deque>
32 #include <math.h>
33 33
34 namespace aimc { 34 namespace aimc {
35 using std::deque; 35 using std::deque;
36 struct StrobePoint { 36 struct StrobePoint {
37 int time; 37 int time;
38 float weight; 38 float weight;
39 float working_weight; 39 float working_weight;
40 StrobePoint() { 40 StrobePoint() {
41 time = 0; 41 time = 0;
42 weight = 0.0f; 42 weight = 0.0f;
43 working_weight = 0.0f; 43 working_weight = 0.0f;
44 } 44 }
45 }; 45 };
46 46
47 /*! 47 /*!
48 * \class Signal "Support/StrobeList.h" 48 * \class Signal "Support/StrobeList.h"
58 }; 58 };
59 59
60 inline ~StrobeList() { 60 inline ~StrobeList() {
61 }; 61 };
62 62
63 //! \brief Return the strobe time (in samples, can be negative) 63 /*! \brief Return the strobe time (in samples, can be negative)
64 */
64 inline StrobePoint Strobe(int strobe_number) { 65 inline StrobePoint Strobe(int strobe_number) {
65 return strobes_.at(strobe_number); 66 return strobes_.at(strobe_number);
66 }; 67 };
67 68
68 //! \brief Set the strobe weight 69 /*! \brief Set the strobe weight
70 */
69 inline void SetWeight(int strobe_number, float weight) { 71 inline void SetWeight(int strobe_number, float weight) {
70 strobes_.at(strobe_number).weight = weight; 72 strobes_.at(strobe_number).weight = weight;
71 }; 73 };
72 74
73 //! \brief Set the strobe's working weight 75 /*! \brief Set the strobe's working weight
76 */
74 inline void SetWorkingWeight(int strobe_number, float working_weight) { 77 inline void SetWorkingWeight(int strobe_number, float working_weight) {
75 strobes_.at(strobe_number).working_weight = working_weight; 78 strobes_.at(strobe_number).working_weight = working_weight;
76 }; 79 };
77 80
78 //! \brief Add a strobe to the list (must be in order) 81 /*! \brief Add a strobe to the list (must be in order)
82 */
79 inline void AddStrobe(int time, float weight) { 83 inline void AddStrobe(int time, float weight) {
80 StrobePoint s; 84 StrobePoint s;
81 s.time = time; 85 s.time = time;
82 s.weight = weight; 86 s.weight = weight;
83 strobes_.push_back(s); 87 strobes_.push_back(s);
84 }; 88 };
85 89
86 //! \brief Delete a strobe from the list 90 /*! \brief Delete a strobe from the list
91 */
87 inline void DeleteFirstStrobe() { 92 inline void DeleteFirstStrobe() {
88 strobes_.pop_front(); 93 strobes_.pop_front();
89 }; 94 };
90 95
91 //! \brief Get the number of strobes 96 /*! \brief Get the number of strobes
97 */
92 inline int strobe_count() const { 98 inline int strobe_count() const {
93 return strobes_.size(); 99 return strobes_.size();
94 }; 100 };
95 101
96 //! \brief Shift the position of all strobes by subtracting offset from 102 /*! \brief Shift the position of all strobes by subtracting offset from
97 //! the time value of each 103 * the time value of each
104 */
98 inline void ShiftStrobes(int offset) { 105 inline void ShiftStrobes(int offset) {
99 for (unsigned int i = 0; i < strobes_.size(); ++i) 106 for (unsigned int i = 0; i < strobes_.size(); ++i)
100 strobes_[i].time -= offset; 107 strobes_[i].time -= offset;
101 }; 108 };
102 109