17 template<
class MorphType>
25 template<
class MorphType>
35 template<
class MorphType>
38 _morphs = copy._morphs;
44 template<
class MorphType>
52 template<
class MorphType>
55 return (_morphs == other._morphs);
61 template<
class MorphType>
64 return (_morphs != other._morphs);
70 template<
class MorphType>
73 return (_morphs < other._morphs);
81 template<
class MorphType>
84 if (_morphs.size() != other._morphs.size()) {
85 return (
int)_morphs.size() - (int)other._morphs.size();
87 for (
size_t i = 0; i < _morphs.size(); i++) {
88 int compare = _morphs[i].compare_to(other._morphs[i], threshold);
99 template<
class MorphType>
102 return _morphs.begin();
108 template<
class MorphType>
111 return _morphs.begin();
117 template<
class MorphType>
120 return _morphs.end();
126 template<
class MorphType>
129 return _morphs.end();
135 template<
class MorphType>
138 return _morphs.size();
144 template<
class MorphType>
147 return _morphs.empty();
157 template<
class MorphType>
160 std::pair<iterator, bool> result;
161 typename Morphs::iterator mi;
162 for (mi = _morphs.begin(); mi != _morphs.end(); ++mi) {
163 if ((*mi) == value) {
166 result.second =
false;
172 _morphs.push_back(value);
173 result.first = _morphs.begin() + _morphs.size() - 1;
174 result.second =
true;
181 template<
class MorphType>
190 template<
class MorphType>
192 write(std::ostream &out,
int indent_level,
const std::string &tag,
193 int num_dimensions)
const {
196 for (i = begin(); i != end(); ++i) {
197 indent(out, indent_level);
198 i->output(out, tag, num_dimensions);
std::pair< iterator, bool > insert(const MorphType &value)
This is similar to the insert() interface for sets, except it does not guarantee that the resulting l...
void clear()
Empties the list of morphs.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
A collection of <Dxyz>'s or <Duv>'s or some such.
int compare_to(const EggMorphList< MorphType > &other, double threshold) const
compare_to() compares a different space than the operator methods, which only check the morph's name.