fpmas 1.6
Public Member Functions | List of all members
fpmas::api::graph::DistributedNodeBuilder< T > Class Template Referenceabstract

#include <graph_builder.h>

Inheritance diagram for fpmas::api::graph::DistributedNodeBuilder< T >:
Inheritance graph
[legend]
Collaboration diagram for fpmas::api::graph::DistributedNodeBuilder< T >:
Collaboration graph
[legend]

Public Member Functions

virtual std::size_t localNodeCount ()=0
 
virtual DistributedNode< T > * buildDistantNode (DistributedId id, int location, DistributedGraph< T > &graph)=0
 
- Public Member Functions inherited from fpmas::api::graph::NodeBuilder< T >
virtual std::size_t nodeCount ()=0
 
virtual DistributedNode< T > * buildNode (DistributedGraph< T > &graph)=0
 

Detailed Description

template<typename T>
class fpmas::api::graph::DistributedNodeBuilder< T >

Distributed extension of the NodeBuilder.

The purpose of the DistributedNodeBuilder is similar to the NodeBuilder, but adds distribution specific features.

Template Parameters
Tgraph datatype

Member Function Documentation

◆ localNodeCount()

template<typename T >
virtual std::size_t fpmas::api::graph::DistributedNodeBuilder< T >::localNodeCount ( )
pure virtual

Returns the count of nodes that the DistributedNodeBuilder can generate on the current process.

The value returned by this function is expected to be updated while buildNode() calls are performed.

Returns
count of nodes that can be built on the local process

Implemented in fpmas::graph::DistributedNodeBuilder< T >, fpmas::graph::DistributedNodeBuilder< int >, and fpmas::graph::DistributedNodeBuilder< AgentPtr >.

◆ buildDistantNode()

template<typename T >
virtual DistributedNode< T > * fpmas::api::graph::DistributedNodeBuilder< T >::buildDistantNode ( DistributedId  id,
int  location,
DistributedGraph< T > &  graph 
)
pure virtual

Builds a distant node in the specified graph, with the provided id. The node is assumed to be currently owned by the process with rank location.

Such a node can be considered as a "temporary" node, that can be used by the underlying algorithm to build edges with nodes that are currently not located on this process.

Implementations are likely to behave as follow:

  1. Dynamically allocates a default DistributedNode
  2. Initiates its location using DistributedNode::setLocation()
  3. Inserts it into the graph using DistributedGraph::insertDistant()
Note
The node returned must be the node effectively contained in the graph at the end of the operation. Indeed, it is allowed to try to insert a DISTANT node already contained in the graph, and implementations might decide to ignore the new node or to replace the existing one, but the node finally contained in the graph must be returned. In any case, it is safe to return the result of DistributedGraph::insertDistant().

Notice that the count of nodes built using this method is not limited and is not correlated to localNodeCount() or nodeCount(), contrary to the buildNode() method.

Parameters
idid of the distant node
locationcurrent node location
graphgraph in which the distant node will be inserted

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