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

#include <distributed_edge.h>

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

Public Member Functions

 DistributedEdge (DistributedId id, LayerId layer)
 
api::graph::LocationState state () const override
 
void setState (api::graph::LocationState state) override
 
void setTempSourceNode (std::unique_ptr< api::graph::TemporaryNode< T > > temp_src) override
 
std::unique_ptr< api::graph::TemporaryNode< T > > getTempSourceNode () override
 
void setTempTargetNode (std::unique_ptr< api::graph::TemporaryNode< T > > temp_tgt) override
 
std::unique_ptr< api::graph::TemporaryNode< T > > getTempTargetNode () override
 
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
 
- Public Member Functions inherited from fpmas::api::graph::DistributedEdge< T >
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< _IdType, _NodeType >
typedef _IdType IdType
 
typedef _NodeType NodeType
 
- 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::graph::DistributedEdge< T >

api::graph::DistributedEdge implementation.

Constructor & Destructor Documentation

◆ DistributedEdge()

template<typename T >
fpmas::graph::DistributedEdge< T >::DistributedEdge ( DistributedId  id,
LayerId  layer 
)
inline

DistributedEdge constructor.

Parameters
idedge id
layerid of the layer on which the edge is located

Member Function Documentation

◆ state()

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

Current state of the edge.

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

Returns
current edge state

Implements fpmas::api::graph::DistributedEdge< T >.

◆ setState()

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

Updates the state of the edge.

Only intended for internal / serialization usage.

Parameters
statenew state

Implements fpmas::api::graph::DistributedEdge< T >.

◆ setTempSourceNode()

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

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 >
std::unique_ptr< api::graph::TemporaryNode< T > > fpmas::graph::DistributedEdge< T >::getTempSourceNode ( )
inlineoverridevirtual

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.

Implements fpmas::api::graph::DistributedEdge< T >.

◆ setTempTargetNode()

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

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 >
std::unique_ptr< api::graph::TemporaryNode< T > > fpmas::graph::DistributedEdge< T >::getTempTargetNode ( )
inlineoverridevirtual

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.

Implements fpmas::api::graph::DistributedEdge< T >.


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