13 #ifndef OGLPLUS_OBJECT_SEQ_TPL_1405011014_HPP
14 #define OGLPLUS_OBJECT_SEQ_TPL_1405011014_HPP
23 template <
typename ObjectT>
27 typedef typename Classify<ObjectT>::ObjTag ObjTag;
28 typedef typename ObjTag::NameType NameT;
38 return a._pos == b._pos;
44 return a._pos != b._pos;
50 return a._pos < b._pos;
62 return a._pos - b._pos;
68 assert(_pos !=
nullptr);
75 assert(_pos !=
nullptr);
132 template <
typename ObjectT>
133 const typename Classify<ObjectT>::ObjTag::NameType*
137 template <
typename ObjectT>
141 typedef typename Classify<ObjectT>::ObjTag ObjTag;
142 typedef typename ObjTag::NameType NameT;
144 friend const NameT* GetNames<ObjectT>(
const Sequence&);
154 Sequence(
const NameT* names, std::size_t count)
172 ObjectT
at(std::size_t index)
const
174 assert(index < _size);
175 return ObjectT(_names[index]);
187 assert(start <= _size);
188 return Sequence(_names+start, _size-start);
194 assert(start + count <= _size);
195 return Sequence(_names+start, count);
217 template <
typename ObjectT>
218 inline const typename Classify<ObjectT>::ObjTag::NameType*
221 return sequence._names;
226 #endif // include guard
Common base class for Object name sequences.
Definition: fwd.hpp:139
friend SeqIterator operator+(SeqIterator a, difference_type d)
Positive offset.
Definition: seq_tpl.hpp:106
Object sequence iterator template.
Definition: seq_tpl.hpp:24
SeqIterator< ObjectT > const_iterator
Const iterator type.
Definition: seq_tpl.hpp:201
bool empty(void) const
Returns true if the sequence is empty.
Definition: seq_tpl.hpp:160
value_type operator[](std::size_t index) const
Array access.
Definition: seq_tpl.hpp:73
SeqIterator & operator++(void)
Preincrement.
Definition: seq_tpl.hpp:80
std::size_t size(void) const
Returns the size of the sequence.
Definition: seq_tpl.hpp:166
SeqIterator & operator+=(difference_type d)
Positive offset.
Definition: seq_tpl.hpp:112
const_iterator end(void) const
Position past the end of the sequence.
Definition: seq_tpl.hpp:210
friend bool operator!=(SeqIterator a, SeqIterator b)
Inequality comparison.
Definition: seq_tpl.hpp:42
SeqIterator & operator--(void)
Predecrement.
Definition: seq_tpl.hpp:93
SeqIterator & operator-=(difference_type d)
Negative offset.
Definition: seq_tpl.hpp:125
const_iterator begin(void) const
Position at the beginning of the sequence.
Definition: seq_tpl.hpp:204
ObjectT operator[](std::size_t index) const
Returns the object name at the specified index.
Definition: seq_tpl.hpp:179
ObjectT value_type
Value type.
Definition: seq_tpl.hpp:54
const Classify< ObjectT >::ObjTag::NameType * GetNames(const Sequence< ObjectT > &)
Returns a pointer to array of names stored in a sequence.
Definition: seq_tpl.hpp:219
value_type operator*(void) const
Dereference.
Definition: seq_tpl.hpp:66
ObjectT at(std::size_t index) const
Returns the object name at the specified index.
Definition: seq_tpl.hpp:172
friend bool operator==(SeqIterator a, SeqIterator b)
Equality comparison.
Definition: seq_tpl.hpp:36
friend bool operator<(SeqIterator a, SeqIterator b)
Ordering.
Definition: seq_tpl.hpp:48
friend difference_type operator-(SeqIterator a, SeqIterator b)
Distance.
Definition: seq_tpl.hpp:60
Sequence slice(std::size_t start) const
Returns a subsequence starting at start.
Definition: seq_tpl.hpp:185
Base template for all "named" objects.
std::ptrdiff_t difference_type
Difference type.
Definition: seq_tpl.hpp:57
SeqIterator< ObjectT > iterator
Iterator type.
Definition: seq_tpl.hpp:199
A common template for "named" objects like textures, buffers, etc.
Definition: fwd.hpp:136
Sequence slice(std::size_t start, std::size_t count) const
Returns a subsequence with the specified count starting at start.
Definition: seq_tpl.hpp:192