C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::cow_vector< class > Class Template Reference

A copy-on-write vector implementation that wraps a std::vector. More...

#include <cow_vector.hpp>

Public Types

using value_type = T
 
using std_type = std::vector<value_type>
 
using size_type = typename std_type::size_type
 
using const_iterator = typename std_type::const_iterator
 
using difference_type = typename std_type::difference_type
 
using const_reverse_iterator = typename std_type::const_reverse_iterator
 

Public Member Functions

 cow_vector (std_type std)
 
 cow_vector (std::initializer_list< T > values)
 
 cow_vector (cow_vector &&) noexcept=default
 
 cow_vector (const cow_vector &) noexcept=default
 
cow_vectoroperator= (cow_vector &&) noexcept=default
 
cow_vectoroperator= (const cow_vector &) noexcept=default
 
std_type & unshared ()
 Returns a mutable reference to the managed vector.
 
const std_type & std () const noexcept
 Returns the managed STD container.
 
bool unique () const noexcept
 Returns whether the reference count of the managed object is 1.
 
bool empty () const noexcept
 
size_type size () const noexcept
 
size_type max_size () const noexcept
 
at (size_type pos) const
 
operator[] (size_type pos) const
 
front () const
 
back () const
 
const T * data () const noexcept
 
const_iterator begin () const noexcept
 
const_iterator cbegin () const noexcept
 
const_reverse_iterator rbegin () const noexcept
 
const_reverse_iterator crbegin () const noexcept
 
const_iterator end () const noexcept
 
const_iterator cend () const noexcept
 
const_reverse_iterator rend () const noexcept
 
const_reverse_iterator crend () const noexcept
 

Friends

template<class Inspector >
bool inspect (Inspector &f, cow_vector &x)
 

Detailed Description

template<class>
class caf::cow_vector< class >

A copy-on-write vector implementation that wraps a std::vector.

Member Function Documentation

◆ unshared()

template<class >
std_type & caf::cow_vector< class >::unshared ( )

Returns a mutable reference to the managed vector.

Copies the vector if more than one reference to it exists to make sure the reference count is exactly 1 when returning from this function.


The documentation for this class was generated from the following files: