STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Protected Types | Protected Attributes
stapl::sequential::vdg_storage_int< Traits > Class Template Reference

An adjacency list using an std::vector for storing vertices. Used inside the adjacency_list_model to store vertices. More...

Public Member Functions

 vdg_storage_int (size_t nv=0)
 Constructs a storage with the given number of vertices starting from zero (0). Vertices have contiguous descriptors. More...
 
 vdg_storage_int (this_type const &other)
 
void resize (size_t nv)
 Resize the internal storage to accommodate specified number of vertices.
 
iterator begin (void)
 
const_iterator begin (void) const
 
iterator end (void)
 
const_iterator end (void) const
 
size_t size (void) const
 Returns the number of vertices in the storage; for use in g.num_vertices().
 
vertex_descriptor add_vertex (vertex_property const &vp)
 Adds vertex to the storage with the given vertex property. The descriptor is assigned automatically using the descriptor generator. More...
 
vertex_descriptor add_vertex (vertex_descriptor const &vd, vertex_property const &vp)
 Adds vertex to the storage with the given descriptor and property. More...
 
bool delete_vertex (vertex_descriptor const &, iterator const &vi)
 Deletes the vertex pointed to by the specified iterator. More...
 
void clear (void)
 Clears the storage container of all vertices and edges, and resets the vertex descriptor generator.
 
iterator find_vertex (vertex_descriptor const &vd)
 Returns an iterator to the specified vertex, or returns an iterator to this->end() if the vertex does not exist.
 
void update_descriptor (vertex_descriptor &vd, iterator const &vi)
 Updates a versioning descriptor with the new iterator. Unused in this class.
 
vertex_descriptor get_max_descriptor (void) const
 Returns the current max descriptor.
 

Public Types

typedef Traits::vertex_descriptor vertex_descriptor
 
typedef Traits::vertex_property vertex_property
 
typedef vertex_set_type::iterator iterator
 
typedef vertex_set_type::const_iterator const_iterator
 

Protected Types

typedef Traits::edge_type edge_type
 
typedef adjacency_descriptor_impl< edge_type > edgelist_type
 
typedef select_vertex< vertex_descriptor, vertex_property, edgelist_type >::type vertex_impl_type
 
typedef vdg_base_int< vertex_descriptor > vdg_type
 Type of the vertex descriptor generator.
 
typedef std::vector< vertex_impl_typevertex_set_type
 The vertices are stored in an std::vector.
 

Protected Attributes

vdg_type m_vdg
 The vertex descriptor generator.
 
vertex_set_type m_storage
 The container for storing vertices.
 

Detailed Description

template<class Traits>
class stapl::sequential::vdg_storage_int< Traits >

An adjacency list using an std::vector for storing vertices. Used inside the adjacency_list_model to store vertices.

Template Parameters
TraitsThe traits class for specifying the types of descriptors, storages, edges and vertices. Contains the physical storage for the Graph, and provides functionality to Add/Delete/Find vertices, and Iterators to access the storage from outside.

Constructor & Destructor Documentation

◆ vdg_storage_int()

template<class Traits >
stapl::sequential::vdg_storage_int< Traits >::vdg_storage_int ( size_t  nv = 0)

Constructs a storage with the given number of vertices starting from zero (0). Vertices have contiguous descriptors.

Parameters
nvThe number of vertices to be initially stored.

Member Function Documentation

◆ add_vertex() [1/2]

template<class Traits >
vertex_descriptor stapl::sequential::vdg_storage_int< Traits >::add_vertex ( vertex_property const &  vp)

Adds vertex to the storage with the given vertex property. The descriptor is assigned automatically using the descriptor generator.

Parameters
vpThe vertex property of the added vertex.
Returns
The descriptor of the added vertex.

◆ add_vertex() [2/2]

template<class Traits >
vertex_descriptor stapl::sequential::vdg_storage_int< Traits >::add_vertex ( vertex_descriptor const &  vd,
vertex_property const &  vp 
)

Adds vertex to the storage with the given descriptor and property.

Parameters
vdThe explicit descriptor of the added vertex.
vpThe vertex property of the added vertex.
Returns
The descriptor of the added vertex.

◆ delete_vertex()

template<class Traits >
bool stapl::sequential::vdg_storage_int< Traits >::delete_vertex ( vertex_descriptor const &  ,
iterator const &  vi 
)

Deletes the vertex pointed to by the specified iterator.

Parameters
viThe iterator of the vertex to be deleted.
Returns
Whether or not the vertex was successfully deleted.

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