13 #ifndef OGLPLUS_OBJECT_ARRAY_1107121519_HPP
14 #define OGLPLUS_OBJECT_ARRAY_1107121519_HPP
17 #include <oglplus/object/seq_tpl.hpp>
18 #include <oglplus/utils/nothing.hpp>
25 template <
typename ObjTag>
28 template <
typename ObjTag>
37 template <
typename Object>
39 :
public ObjGenDelOps<typename Classify<Object>::ObjTag>
42 typedef typename Classify<Object>::OpsTag OpsTag;
43 typedef typename Classify<Object>::ObjTag ObjTag;
44 typedef typename ObjGenTag<OpsTag, ObjTag>::Type GenTag;
45 typedef ObjGenDelOps<ObjTag> GenDelOps;
50 typedef typename ObjTag::NameType NameT;
51 std::vector<NameT> _names;
55 GenDelOps::Gen(GenTag(), GLsizei(_names.size()), _names.data());
58 template <
typename ObjectSubtype>
59 void _init(ObjectSubtype type)
61 this->_type = decltype(this->_type)(type);
67 : _names(std::move(temp._names))
78 Array(std::size_t n,
typename ObjectSubtype<ObjTag>::Type type)
89 GLsizei(_names.size()),
98 return _names.empty();
104 return _names.size();
167 operator Sequence<ObjectName<ObjTag>> (void)
const
175 #endif // include guard
Array(std::size_t count)
Constructs an an array of count instances of Object.
Definition: array.hpp:71
Common base class for Object name sequences.
Definition: fwd.hpp:139
Reference< Object > reference
Reference to elements.
Definition: array.hpp:108
const_iterator end(void) const
Returns an iterator pointing past the last element.
Definition: array.hpp:150
iterator const_iterator
Const-iterator type.
Definition: array.hpp:141
Object sequence iterator template.
Definition: seq_tpl.hpp:24
Reference to an existing Object.
const_iterator begin(void) const
Returns an iterator pointing to the first element.
Definition: array.hpp:144
std::size_t size(void) const
Returns the number of instances in the array.
Definition: array.hpp:102
reference operator[](std::size_t index)
Returns a reference to the i-th instance in the array.
Definition: array.hpp:126
SeqIterator< Object > iterator
Iterator type.
Definition: array.hpp:138
Array(Array &&temp)
Array is moveable.
Definition: array.hpp:66
bool empty(void) const
Returns true if the array is empty.
Definition: array.hpp:96
Array(std::size_t n, typename ObjectSubtype< ObjTag >::Type type)
Constructs an an array of n instances of Object with type.
Definition: array.hpp:78
reference at(std::size_t index)
Returns a reference to the i-th instance in the array.
Definition: array.hpp:114
const_reference at(NameT index) const
Returns a const reference to the i-th instance in the array.
Definition: array.hpp:120
Allows to allocate and manage several instances of Object at the same time.
Definition: fwd.hpp:183
A common template for "named" objects like textures, buffers, etc.
Definition: fwd.hpp:136
Allows to make managed copies of instances of Object.
Definition: fwd.hpp:172
const reference const_reference
Reference to const elements.
Definition: array.hpp:111
const_reference operator[](std::size_t index) const
Returns a const reference to the i-th instance in the array.
Definition: array.hpp:132