Metall  v0.29
A persistent memory allocator for data-centric analytics
metall::container::experimental::jgraph::jgraph< _allocator_type > Class Template Reference

#include </home/runner/work/metall/metall/include/metall/container/experimental/jgraph/jgraph.hpp>

Public Types

using allocator_type = _allocator_type
 
using id_type = std::string_view
 The type of vertex ID and edge ID. More...
 
using value_type = mj::value< allocator_type >
 JSON value type every vertex and edge has,. More...
 
using vertex_iterator = jgdtl::vertex_iterator_impl< typename vertex_storage_type::iterator >
 Vertex iterator over a container of vertex data, which is metall::container::experimental::json::key_value_pair_type. More...
 
using const_vertex_iterator = jgdtl::vertex_iterator_impl< typename vertex_storage_type::const_iterator >
 Const vertex iterator. More...
 
using edge_iterator = jgdtl::edge_iterator_impl< typename adj_list_edge_list_type::iterator, typename std::pointer_traits< typename std::allocator_traits< allocator_type >::pointer >::template rebind< edge_storage_type > >
 Edge iterator over a container of edge data, which is metall::container::experimental::json::key_value_pair_type. More...
 
using const_edge_iterator = jgdtl::edge_iterator_impl< typename adj_list_edge_list_type::const_iterator, typename std::pointer_traits< typename std::allocator_traits< allocator_type >::pointer >::template rebind< const edge_storage_type > >
 Const edge iterator. More...
 

Public Member Functions

 jgraph (const allocator_type &alloc=allocator_type())
 Constructor. More...
 
bool has_vertex (const id_type &vertex_id) const
 Checks if a vertex exists. More...
 
std::size_t has_edges (const id_type &source_vertex_id, const id_type &destination_vertex_id) const
 
vertex_iterator register_vertex (const id_type &vertex_id)
 
edge_iterator register_edge (const id_type &source_vertex_id, const id_type &destination_vertex_id, const bool undirected=false)
 
vertex_iterator find_vertex (const id_type &vertex_id)
 
const_vertex_iterator find_vertex (const id_type &vertex_id) const
 
std::pair< edge_iterator, edge_iteratorfind_edges (const id_type &source_vertex_id, const id_type &destination_vertex_id)
 
std::size_t num_vertices () const
 Returns the number of vertices. More...
 
std::size_t num_edges () const
 Returns the number of edges. More...
 
std::size_t degree (const id_type &vertex_id) const
 Returns the degree of the vertex corresponds to 'vid'. More...
 
vertex_iterator vertices_begin ()
 
const_vertex_iterator vertices_begin () const
 
vertex_iterator vertices_end ()
 
const_vertex_iterator vertices_end () const
 
edge_iterator edges_begin (const id_type &vid)
 
const_edge_iterator edges_begin (const id_type &vid) const
 
edge_iterator edges_end (const id_type &vid)
 
const_edge_iterator edges_end (const id_type &vid) const
 
allocator_type get_allocator () const
 

Member Typedef Documentation

◆ allocator_type

template<typename _allocator_type = std::allocator<std::byte>>
using metall::container::experimental::jgraph::jgraph< _allocator_type >::allocator_type = _allocator_type

◆ id_type

template<typename _allocator_type = std::allocator<std::byte>>
using metall::container::experimental::jgraph::jgraph< _allocator_type >::id_type = std::string_view

The type of vertex ID and edge ID.

◆ value_type

template<typename _allocator_type = std::allocator<std::byte>>
using metall::container::experimental::jgraph::jgraph< _allocator_type >::value_type = mj::value<allocator_type>

JSON value type every vertex and edge has,.

◆ vertex_iterator

template<typename _allocator_type = std::allocator<std::byte>>
using metall::container::experimental::jgraph::jgraph< _allocator_type >::vertex_iterator = jgdtl::vertex_iterator_impl<typename vertex_storage_type::iterator>

Vertex iterator over a container of vertex data, which is metall::container::experimental::json::key_value_pair_type.

◆ const_vertex_iterator

template<typename _allocator_type = std::allocator<std::byte>>
using metall::container::experimental::jgraph::jgraph< _allocator_type >::const_vertex_iterator = jgdtl::vertex_iterator_impl<typename vertex_storage_type::const_iterator>

Const vertex iterator.

◆ edge_iterator

template<typename _allocator_type = std::allocator<std::byte>>
using metall::container::experimental::jgraph::jgraph< _allocator_type >::edge_iterator = jgdtl::edge_iterator_impl< typename adj_list_edge_list_type::iterator, typename std::pointer_traits<typename std::allocator_traits< allocator_type>::pointer>::template rebind<edge_storage_type> >

Edge iterator over a container of edge data, which is metall::container::experimental::json::key_value_pair_type.

◆ const_edge_iterator

template<typename _allocator_type = std::allocator<std::byte>>
using metall::container::experimental::jgraph::jgraph< _allocator_type >::const_edge_iterator = jgdtl::edge_iterator_impl< typename adj_list_edge_list_type::const_iterator, typename std::pointer_traits<typename std::allocator_traits< allocator_type>::pointer>::template rebind<const edge_storage_type> >

Const edge iterator.

Constructor & Destructor Documentation

◆ jgraph()

template<typename _allocator_type = std::allocator<std::byte>>
metall::container::experimental::jgraph::jgraph< _allocator_type >::jgraph ( const allocator_type alloc = allocator_type())
inlineexplicit

Constructor.

Parameters
allocAn allocator object

Member Function Documentation

◆ has_vertex()

template<typename _allocator_type = std::allocator<std::byte>>
bool metall::container::experimental::jgraph::jgraph< _allocator_type >::has_vertex ( const id_type vertex_id) const
inline

Checks if a vertex exists.

Parameters
vertex_idA vertex ID to check.
Returns
Returns true if the vertex exists; otherwise, returns false.

◆ has_edges()

template<typename _allocator_type = std::allocator<std::byte>>
std::size_t metall::container::experimental::jgraph::jgraph< _allocator_type >::has_edges ( const id_type source_vertex_id,
const id_type destination_vertex_id 
) const
inline

◆ register_vertex()

template<typename _allocator_type = std::allocator<std::byte>>
vertex_iterator metall::container::experimental::jgraph::jgraph< _allocator_type >::register_vertex ( const id_type vertex_id)
inline

◆ register_edge()

template<typename _allocator_type = std::allocator<std::byte>>
edge_iterator metall::container::experimental::jgraph::jgraph< _allocator_type >::register_edge ( const id_type source_vertex_id,
const id_type destination_vertex_id,
const bool  undirected = false 
)
inline

◆ find_vertex() [1/2]

template<typename _allocator_type = std::allocator<std::byte>>
vertex_iterator metall::container::experimental::jgraph::jgraph< _allocator_type >::find_vertex ( const id_type vertex_id)
inline

◆ find_vertex() [2/2]

template<typename _allocator_type = std::allocator<std::byte>>
const_vertex_iterator metall::container::experimental::jgraph::jgraph< _allocator_type >::find_vertex ( const id_type vertex_id) const
inline

◆ find_edges()

template<typename _allocator_type = std::allocator<std::byte>>
std::pair<edge_iterator, edge_iterator> metall::container::experimental::jgraph::jgraph< _allocator_type >::find_edges ( const id_type source_vertex_id,
const id_type destination_vertex_id 
)
inline

◆ num_vertices()

template<typename _allocator_type = std::allocator<std::byte>>
std::size_t metall::container::experimental::jgraph::jgraph< _allocator_type >::num_vertices ( ) const
inline

Returns the number of vertices.

Returns
The number of vertices.

◆ num_edges()

template<typename _allocator_type = std::allocator<std::byte>>
std::size_t metall::container::experimental::jgraph::jgraph< _allocator_type >::num_edges ( ) const
inline

Returns the number of edges.

Returns
The number of edges.

◆ degree()

template<typename _allocator_type = std::allocator<std::byte>>
std::size_t metall::container::experimental::jgraph::jgraph< _allocator_type >::degree ( const id_type vertex_id) const
inline

Returns the degree of the vertex corresponds to 'vid'.

Parameters
vertex_idA vertex ID.
Returns
Returns the degree of the vertex corresponds to 'vid'. If no vertex is associated with 'vid', returns 0.

◆ vertices_begin() [1/2]

template<typename _allocator_type = std::allocator<std::byte>>
vertex_iterator metall::container::experimental::jgraph::jgraph< _allocator_type >::vertices_begin ( )
inline

◆ vertices_begin() [2/2]

template<typename _allocator_type = std::allocator<std::byte>>
const_vertex_iterator metall::container::experimental::jgraph::jgraph< _allocator_type >::vertices_begin ( ) const
inline

◆ vertices_end() [1/2]

template<typename _allocator_type = std::allocator<std::byte>>
vertex_iterator metall::container::experimental::jgraph::jgraph< _allocator_type >::vertices_end ( )
inline

◆ vertices_end() [2/2]

template<typename _allocator_type = std::allocator<std::byte>>
const_vertex_iterator metall::container::experimental::jgraph::jgraph< _allocator_type >::vertices_end ( ) const
inline

◆ edges_begin() [1/2]

template<typename _allocator_type = std::allocator<std::byte>>
edge_iterator metall::container::experimental::jgraph::jgraph< _allocator_type >::edges_begin ( const id_type vid)
inline

◆ edges_begin() [2/2]

template<typename _allocator_type = std::allocator<std::byte>>
const_edge_iterator metall::container::experimental::jgraph::jgraph< _allocator_type >::edges_begin ( const id_type vid) const
inline

◆ edges_end() [1/2]

template<typename _allocator_type = std::allocator<std::byte>>
edge_iterator metall::container::experimental::jgraph::jgraph< _allocator_type >::edges_end ( const id_type vid)
inline

◆ edges_end() [2/2]

template<typename _allocator_type = std::allocator<std::byte>>
const_edge_iterator metall::container::experimental::jgraph::jgraph< _allocator_type >::edges_end ( const id_type vid) const
inline

◆ get_allocator()

template<typename _allocator_type = std::allocator<std::byte>>
allocator_type metall::container::experimental::jgraph::jgraph< _allocator_type >::get_allocator ( ) const
inline

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