comparison transform/Transform.cpp @ 400:78dd9b35559b

* transform operator<
author Chris Cannam
date Thu, 03 Apr 2008 08:30:25 +0000
parents 9d70f577d6f5
children 3012af787e4a
comparison
equal deleted inserted replaced
399:0f0f08c22552 400:78dd9b35559b
105 Transform::~Transform() 105 Transform::~Transform()
106 { 106 {
107 } 107 }
108 108
109 bool 109 bool
110 Transform::operator==(const Transform &t) 110 Transform::operator==(const Transform &t) const
111 { 111 {
112 return 112 return
113 m_id == t.m_id && 113 m_id == t.m_id &&
114 m_parameters == t.m_parameters && 114 m_parameters == t.m_parameters &&
115 m_configuration == t.m_configuration && 115 m_configuration == t.m_configuration &&
118 m_blockSize == t.m_blockSize && 118 m_blockSize == t.m_blockSize &&
119 m_windowType == t.m_windowType && 119 m_windowType == t.m_windowType &&
120 m_startTime == t.m_startTime && 120 m_startTime == t.m_startTime &&
121 m_duration == t.m_duration && 121 m_duration == t.m_duration &&
122 m_sampleRate == t.m_sampleRate; 122 m_sampleRate == t.m_sampleRate;
123 }
124
125 bool
126 Transform::operator<(const Transform &t) const
127 {
128 if (m_id != t.m_id) {
129 return m_id < t.m_id;
130 }
131 if (m_parameters != t.m_parameters) {
132 return mapLessThan<QString, float>(m_parameters, t.m_parameters);
133 }
134 if (m_configuration != t.m_configuration) {
135 return mapLessThan<QString, QString>(m_configuration, t.m_configuration);
136 }
137 if (m_program != t.m_program) {
138 return m_program < t.m_program;
139 }
140 if (m_stepSize != t.m_stepSize) {
141 return m_stepSize < t.m_stepSize;
142 }
143 if (m_blockSize != t.m_blockSize) {
144 return m_blockSize < t.m_blockSize;
145 }
146 if (m_windowType != t.m_windowType) {
147 return m_windowType < t.m_windowType;
148 }
149 if (m_startTime != t.m_startTime) {
150 return m_startTime < t.m_startTime;
151 }
152 if (m_duration != t.m_duration) {
153 return m_duration < t.m_duration;
154 }
155 if (m_sampleRate != t.m_sampleRate) {
156 return m_sampleRate < t.m_sampleRate;
157 }
158 return false;
123 } 159 }
124 160
125 void 161 void
126 Transform::setIdentifier(TransformId id) 162 Transform::setIdentifier(TransformId id)
127 { 163 {