raiigraph
C++ RAII for igraph data structures
|
Wrapper around igraph_vector_*_t
objects with RAII behavior.
More...
#include <Vector.hpp>
Public Types | |
typedef Ns_::igraph_type | igraph_type |
typedef Ns_::value_type | value_type |
typedef value_type & | reference |
typedef const value_type & | const_reference |
typedef igraph_integer_t | size_type |
typedef igraph_integer_t | difference_type |
typedef value_type * | iterator |
typedef const value_type * | const_iterator |
typedef std::reverse_iterator< iterator > | reverse_iterator |
typedef std::reverse_iterator< const_iterator > | reverse_const_iterator |
Wrapper around igraph_vector_*_t
objects with RAII behavior.
Ns_ | Structure-based namespace with static methods, internal use only. |
This class has ownership of the underlying igraph_vector_*_t
object, handling both its initialization and destruction. Users should only pass instances of this class to igraph functions that accept an already-initialized vector. Users should not attempt to destroy the vector manually as this is done automatically when the Vector
goes out of scope.
typedef const value_type* raiigraph::Vector< Ns_ >::const_iterator |
Const iterator for the vector contents.
typedef const value_type& raiigraph::Vector< Ns_ >::const_reference |
Type of a const reference to values inside the vector.
typedef igraph_integer_t raiigraph::Vector< Ns_ >::difference_type |
Integer type for differences in positions within the vector.
typedef Ns_::igraph_type raiigraph::Vector< Ns_ >::igraph_type |
Type of the underlying igraph vector.
typedef value_type* raiigraph::Vector< Ns_ >::iterator |
Iterator for the vector contents.
typedef value_type& raiigraph::Vector< Ns_ >::reference |
Type of the reference to values inside the vector.
typedef std::reverse_iterator<const_iterator> raiigraph::Vector< Ns_ >::reverse_const_iterator |
Reverse const iterator for the vector contents.
typedef std::reverse_iterator<iterator> raiigraph::Vector< Ns_ >::reverse_iterator |
Reverse iterator for the vector contents.
typedef igraph_integer_t raiigraph::Vector< Ns_ >::size_type |
Integer type for the size of the vector.
typedef Ns_::value_type raiigraph::Vector< Ns_ >::value_type |
Type of the values inside the vector.
|
inline |
Default constructor, creates an initialized vector of length 0.
|
inline |
size | Size of the vector to create. |
val | Value to use to fill the vector. |
|
inline |
vector | An initialized vector to take ownership of. |
|
inline |
InputIterator | Iterator type that supports forward increments and subtraction. |
first | Iterator to the start of a range. |
last | Iterator to the end of a range (i.e., past the final element in the range). |
other | Vector to be copy-constructed from. This constructor will make a deep copy. |
other | Vector to be move-constructed from. This constructor will leave other in a valid but unspecified state. |
|
inline |
Destructor.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Clear this vector, leaving it with a size of zero.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Construct and insert an element into the vector.
pos | Position at which to insert the new element. |
args | Arguments for the value_type constructor. |
|
inline |
Construct and add a new element to the end of the vector.
args | Arguments for the value_type constructor. |
|
inline |
|
inline |
|
inline |
|
inline |
Erase an element from the vector.
first | Start of the range of elements to remove. |
last | End of the range of elements to remove. |
Erase an element from the vector.
pos | Position at which to erase the element. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Insert a sequence of elements into the vector.
InputIterator | Iterator type that supports forward increments and subtraction. |
pos | Position at which to insert the new elements. |
first | Iterator to the start of a range. |
last | Iterator to the end of a range (i.e., past the final element in the range). |
|
inline |
Insert multiple copies of an element into the vector.
pos | Position at which to insert the new elements. |
n | Number of values to insert. |
val | Value to be inserted. |
|
inline |
Insert an element into the vector.
pos | Position at which to insert the new element. |
val | Value to be inserted. |
|
inlineconstexpr |
|
inline |
|
inline |
|
inline |
other | Vector to be copy-assigned from. This constructor will make a deep copy. |
|
inline |
other | Vector to be move-assigned from. This constructor will leave other in a valid but unspecified state. |
|
inline |
i | Index on the vector. |
i
.
|
inline |
i | Index on the vector. |
i
.
|
inline |
Remove an element from the end of the vector.
|
inline |
Add a new element to the end of the vector.
val | Value to be added. |
|
inline |
|
inline |
|
inline |
|
inline |
Reserve the capacity of the vector.
capacity | Capacity of the vector. |
|
inline |
Resize the vector to the specified size
.
size | New size of the vector. |
val | Value to use to fill the new elements, if size is greater than the current size. |
|
inline |
Shrink the capacity of the vector to fit the contents.
|
inline |
Swap two vectors, maintaining the validity of existing pointers to each vector and its elements.
other | Vector to be swapped. |