18#ifndef MCRL2_ATERMPP_STANDARD_CONTAINER_VECTOR_H
19#define MCRL2_ATERMPP_STANDARD_CONTAINER_VECTOR_H
32template <
class T,
class Alloc = std::allocator<detail::reference_aterm<T> >,
bool ThreadSafe = false >
33class vector :
public std::vector< detail::reference_aterm<T>, Alloc >
36 typedef std::vector< detail::reference_aterm<T>, Alloc >
super;
68 :
super::
vector(n, detail::reference_aterm(val), alloc),
73 template <
class InputIterator>
120 if constexpr (ThreadSafe) {
122 super::shrink_to_fit();
125 super::shrink_to_fit();
131 if constexpr (ThreadSafe) {
142 if constexpr (ThreadSafe) {
146 return super::insert(pos, value);
150 return super::insert(pos, value);
155 if constexpr (ThreadSafe) {
157 return super::insert(pos, value);
161 return super::insert(pos, value);
166 if constexpr (ThreadSafe) {
168 return super::insert(pos, count, value);
172 return super::insert(pos, count, value);
175 template<
class InputIt >
177 InputIt first, InputIt last )
179 if constexpr (ThreadSafe) {
181 return super::insert(pos, first, last);
185 return super::insert(pos, first, last);
190 if constexpr (ThreadSafe) {
192 return super::insert(pos, ilist);
196 return super::insert(pos, ilist);
199 template<
class... Args >
202 if constexpr (ThreadSafe) {
204 return super::emplace(pos, args...);
208 return super::emplace(pos, args...);
213 if constexpr (ThreadSafe) {
215 return super::erase(pos);
219 return super::erase(pos);
224 if constexpr (ThreadSafe) {
226 return super::erase(first, last);
230 return super::erase(first, last);
235 if constexpr (ThreadSafe)
238 super::push_back(value);
243 super::push_back(value);
249 if constexpr (ThreadSafe)
252 super::push_back(value);
257 super::push_back(value);
261 template<
class... Args >
264 if constexpr (ThreadSafe) {
266 return super::emplace_back(args...);
270 return super::emplace_back(args...);
275 if constexpr (ThreadSafe)
289 if constexpr (ThreadSafe)
292 super::resize(count);
297 super::resize(count);
303 if constexpr (ThreadSafe)
306 super::resize(count, value);
311 super::resize(count, value);
317 if constexpr (ThreadSafe)
333 return super::size();
mcrl2::utilities::lock_guard lock()
Acquire an exclusive lock.
mcrl2::utilities::shared_guard lock_shared()
Acquire a shared lock on this thread aterm pool.
A vector class in which aterms can be stored.
iterator insert(const_iterator pos, InputIt first, InputIt last)
vector & operator=(const vector &x)=default
Assignment operator.
iterator insert(const_iterator pos, std::initializer_list< T > ilist)
vector & operator=(vector &&x)=default
Move assignment operator.
iterator insert(const_iterator pos, T &&value)
~vector()
Standard destructor.
void swap(vector &other) noexcept
super::allocator_type allocator_type
Standard typedefs.
iterator emplace(const_iterator pos, Args &&... args)
void push_back(const T &value)
iterator insert(const_iterator pos, size_type count, const T &value)
super::reference reference
vector(const vector &x, const allocator_type &alloc)
Constructor.
void push_back(T &&value)
super::value_type value_type
vector(vector &&x)
Constructor.
iterator erase(const_iterator first, const_iterator last)
vector(const allocator_type &alloc)
Constructor.
void resize(size_type count, const value_type &value)
vector(InputIterator first, InputIterator last, const allocator_type &alloc=allocator_type())
Constructor.
super::const_iterator const_iterator
super::size_type size_type
vector(vector &&x, const allocator_type &alloc)
Constructor.
vector(size_type n, const allocator_type &alloc=allocator_type())
Constructor.
iterator erase(const_iterator pos)
iterator insert(const_iterator pos, const T &value)
vector(const vector &x)
Constructor.
void resize(size_type count)
detail::generic_aterm_container< std::vector< detail::reference_aterm< T >, Alloc > > container_wrapper
reference emplace_back(Args &&... args)
vector(std::initializer_list< value_type > il, const allocator_type &alloc=allocator_type())
Constructor. To be done later....
vector()
Default constructor.
std::vector< detail::reference_aterm< T >, Alloc > super
vector(size_type n, const value_type &val, const allocator_type &alloc=allocator_type())
An exclusive lock guard for the shared_mutex.
A shared lock guard for the shared_mutex.
thread_aterm_pool & g_thread_term_pool()
A reference to the thread local term pool storage.
The main namespace for the aterm++ library.