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

#include <distributed_edge.h>

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

Public Member Functions

virtual LocationState state () const =0
 
virtual void setState (LocationState state)=0
 
virtual void setTempSourceNode (std::unique_ptr< api::graph::TemporaryNode< T > > temp_src)=0
 
virtual std::unique_ptr< TemporaryNode< T > > getTempSourceNode ()=0
 
virtual void setTempTargetNode (std::unique_ptr< api::graph::TemporaryNode< T > > temp_tgt)=0
 
virtual std::unique_ptr< TemporaryNode< T > > getTempTargetNode ()=0
 
- Public Member Functions inherited from fpmas::api::graph::Edge< DistributedId, DistributedNode< T > >
virtual IdType getId () const=0
 
virtual LayerId getLayer () const=0
 
virtual void setLayer (LayerId layer)=0
 
virtual float getWeight () const=0
 
virtual void setWeight (float weight)=0
 
virtual void setSourceNode (NodeType *const src)=0
 
virtual NodeTypegetSourceNode () const=0
 
virtual void setTargetNode (NodeType *const tgt)=0
 
virtual NodeTypegetTargetNode () const=0
 

Additional Inherited Members

- Public Types inherited from fpmas::api::graph::Edge< DistributedId, DistributedNode< T > >
typedef DistributedId IdType
 
typedef DistributedNode< T > NodeType
 

Detailed Description

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

DistributedEdge API.

The DistributedEdge is an extension of the Edge API, specialized using DistributedId and DistributedNode, and introduces some distribution related concepts.

Template Parameters
Tassociated node data type

Member Function Documentation

◆ state()

template<typename T >
virtual LocationState fpmas::api::graph::DistributedEdge< T >::state ( ) const
pure virtual

Current state of the edge.

A DistributedEdge is LOCAL iff its source and target nodes are LOCAL.

Returns
current edge state

Implemented in fpmas::graph::DistributedEdge< T >.

◆ setState()

template<typename T >
virtual void fpmas::api::graph::DistributedEdge< T >::setState ( LocationState  state)
pure virtual

Updates the state of the edge.

Only intended for internal / serialization usage.

Parameters
statenew state

Implemented in fpmas::graph::DistributedEdge< T >.

◆ setTempSourceNode()

template<typename T >
virtual void fpmas::api::graph::DistributedEdge< T >::setTempSourceNode ( std::unique_ptr< api::graph::TemporaryNode< T > >  temp_src)
pure virtual

Sets the temporary source node of this DistributedEdge.

The temp_src unique_ptr is moved internally so that the current DistributedEdge instance takes ownership of it.

This unique_ptr instance can be retrieve from getTempSourceNode().

Parameters
temp_srcpointer to temporary source node

◆ getTempSourceNode()

template<typename T >
virtual std::unique_ptr< TemporaryNode< T > > fpmas::api::graph::DistributedEdge< T >::getTempSourceNode ( )
pure virtual

Gets the current temporary source node attached to this DistributedEdge.

The caller takes ownership of the unique_ptr, leaving the current temporary source node in a null state.

Warning
Ownership of temporary nodes should be manages carefully. Indeed, the following example would produce a segmentation fault, since the unique_ptr would be deleted at the first getTempSourceNode() call:
auto id = edge->getTempSourceNode()->getId();
auto edge = edge->getTempSourceNode()->build();

However, the following is valid:

// Takes ownership of the temporary node
{
auto temp_node = edge->getTempSourceNode();
auto id = temp_node->getId();
auto node = temp_node->build();
// temp_node automatically deleted at the end of the scope
}
Returns
current temporary source node. Might be null.

Implemented in fpmas::graph::DistributedEdge< T >.

◆ setTempTargetNode()

template<typename T >
virtual void fpmas::api::graph::DistributedEdge< T >::setTempTargetNode ( std::unique_ptr< api::graph::TemporaryNode< T > >  temp_tgt)
pure virtual

Sets the temporary target node of this DistributedEdge.

The temp_tgt unique_ptr is moved internally so that the current DistributedEdge instance takes ownership of it.

This unique_ptr instance can be retrieve from getTempTargetNode().

Parameters
temp_tgtpointer to temporary target node

◆ getTempTargetNode()

template<typename T >
virtual std::unique_ptr< TemporaryNode< T > > fpmas::api::graph::DistributedEdge< T >::getTempTargetNode ( )
pure virtual

Gets the current temporary target node attached to this DistributedEdge.

The caller takes ownership of the unique_ptr, leaving the current temporary target node in a null state.

Warning
See getTempSourceNode().
Returns
current temporary target node. Might be null.

Implemented in fpmas::graph::DistributedEdge< T >.


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