Apache GraphAr C++ Library
The C++ Library for Apache GraphAr
Public Member Functions | List of all members
graphar::builder::Vertex Class Reference

Vertex is designed for constructing vertices builder. More...

#include <vertices_builder.h>

Public Member Functions

 Vertex (IdType id)
 Initialize the vertex with a given id. More...
 
IdType GetId () const noexcept
 Get id of the vertex. More...
 
void SetId (IdType id)
 Set id of the vertex. More...
 
bool Empty () const noexcept
 Check if the vertex is empty. More...
 
void AddProperty (const std::string &name, const std::any &val)
 Add a property to the vertex. More...
 
const std::any & GetProperty (const std::string &property) const
 Get a property of the vertex. More...
 
const std::unordered_map< std::string, std::any > & GetProperties () const
 Get all properties of the vertex. More...
 
bool ContainProperty (const std::string &property)
 Check if the vertex contains a property. More...
 

Detailed Description

Vertex is designed for constructing vertices builder.

Definition at line 45 of file vertices_builder.h.

Constructor & Destructor Documentation

◆ Vertex()

graphar::builder::Vertex::Vertex ( IdType  id)
inlineexplicit

Initialize the vertex with a given id.

Parameters
idThe id of the vertex.

Definition at line 54 of file vertices_builder.h.

Member Function Documentation

◆ AddProperty()

void graphar::builder::Vertex::AddProperty ( const std::string &  name,
const std::any &  val 
)
inline

Add a property to the vertex.

Parameters
nameThe name of the property.
valThe value of the property.

Definition at line 84 of file vertices_builder.h.

◆ ContainProperty()

bool graphar::builder::Vertex::ContainProperty ( const std::string &  property)
inline

Check if the vertex contains a property.

Parameters
propertyThe name of the property.
Returns
true/false.

Definition at line 115 of file vertices_builder.h.

◆ Empty()

bool graphar::builder::Vertex::Empty ( ) const
inlinenoexcept

Check if the vertex is empty.

Returns
true/false.

Definition at line 75 of file vertices_builder.h.

◆ GetId()

IdType graphar::builder::Vertex::GetId ( ) const
inlinenoexcept

Get id of the vertex.

Returns
The id of the vertex.

Definition at line 61 of file vertices_builder.h.

◆ GetProperties()

const std::unordered_map<std::string, std::any>& graphar::builder::Vertex::GetProperties ( ) const
inline

Get all properties of the vertex.

Returns
The map containing all properties of the vertex.

Definition at line 104 of file vertices_builder.h.

◆ GetProperty()

const std::any& graphar::builder::Vertex::GetProperty ( const std::string &  property) const
inline

Get a property of the vertex.

Parameters
propertyThe name of the property.
Returns
The value of the property.

Definition at line 95 of file vertices_builder.h.

◆ SetId()

void graphar::builder::Vertex::SetId ( IdType  id)
inline

Set id of the vertex.

Parameters
idThe id of the vertex.

Definition at line 68 of file vertices_builder.h.


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