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

#include <distributed_node.h>

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

Public Types

typedef T data_type
 
- Public Types inherited from fpmas::api::graph::Node< DistributedId, DistributedEdge< T > >
typedef DistributedId IdType
 
typedef DistributedEdge< T > EdgeType
 

Public Member Functions

virtual int location () const =0
 
virtual void setLocation (int location)=0
 
virtual LocationState state () const =0
 
virtual void setState (LocationState state)=0
 
virtual T & data ()=0
 
virtual const T & data () const =0
 
virtual void setMutex (synchro::Mutex< T > *mutex)=0
 
virtual synchro::Mutex< T > * mutex ()=0
 
virtual const synchro::Mutex< T > * mutex () const =0
 
- Public Member Functions inherited from fpmas::api::graph::Node< DistributedId, DistributedEdge< T > >
virtual IdType getId () const=0
 
virtual float getWeight () const=0
 
virtual void setWeight (float weight)=0
 
virtual const std::vector< EdgeType * > getIncomingEdges () const=0
 
virtual const std::vector< EdgeType * > getIncomingEdges (LayerId layer_id) const=0
 
virtual const std::vector< typename EdgeType::NodeType * > inNeighbors () const=0
 
virtual const std::vector< typename EdgeType::NodeType * > inNeighbors (LayerId layer_id) const=0
 
virtual const std::vector< EdgeType * > getOutgoingEdges () const=0
 
virtual const std::vector< EdgeType * > getOutgoingEdges (LayerId layer_id) const=0
 
virtual const std::vector< typename EdgeType::NodeType * > outNeighbors () const=0
 
virtual const std::vector< typename EdgeType::NodeType * > outNeighbors (LayerId layer_id) const=0
 
virtual void linkIn (EdgeType *edge)=0
 
virtual void linkOut (EdgeType *edge)=0
 
virtual void unlinkIn (EdgeType *edge)=0
 
virtual void unlinkOut (EdgeType *edge)=0
 

Detailed Description

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

DistributedNode API.

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

The class also introduces T, the type of the data contained in the DistributedNode. Each DistributedNode instance owns an instance of T.

Template Parameters
Tdata type

Member Typedef Documentation

◆ data_type

template<typename T >
typedef T fpmas::api::graph::DistributedNode< T >::data_type

Type of data contained in the node.

Member Function Documentation

◆ location()

template<typename T >
virtual int fpmas::api::graph::DistributedNode< T >::location ( ) const
pure virtual

Rank of the process on which this node is currently located.

If the node is LOCAL, this rank corresponds to the current process.

Returns
node location

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

◆ setLocation()

template<typename T >
virtual void fpmas::api::graph::DistributedNode< T >::setLocation ( int  location)
pure virtual

Updates the location of the node.

Only used for internal / serialization.

Parameters
locationnew location

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

◆ state()

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

Current state of the node.

A DistributedNode is LOCAL iff it is currently hosted and managed by the current process. A DISTANT DistributedNode correspond to a representation of a node currently hosted by an other process.

Returns
current node state

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

◆ setState()

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

Updates the state of the node.

Only intended for internal / serialization usage.

Parameters
statenew state

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

◆ data() [1/2]

template<typename T >
virtual T & fpmas::api::graph::DistributedNode< T >::data ( )
pure virtual

Returns a reference to the internal node data.

Returns
reference to node's data

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

◆ data() [2/2]

template<typename T >
virtual const T & fpmas::api::graph::DistributedNode< T >::data ( ) const
pure virtual

Returns a reference to the internal node data.

Returns
reference to node's data

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

◆ setMutex()

template<typename T >
virtual void fpmas::api::graph::DistributedNode< T >::setMutex ( synchro::Mutex< T > *  mutex)
pure virtual

Sets the internal mutex of the node.

The concrete mutex type used might depend on the graph synchronization mode.

Parameters
mutexnode mutex

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

◆ mutex() [1/2]

template<typename T >
virtual synchro::Mutex< T > * fpmas::api::graph::DistributedNode< T >::mutex ( )
pure virtual

Internal node mutex.

The role of the mutex is to protect the access to the internal T instance. The data references return by the Mutex methods correspond the node's internal T instance.

Returns
pointer to the internal node mutex

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

◆ mutex() [2/2]

template<typename T >
virtual const synchro::Mutex< T > * fpmas::api::graph::DistributedNode< T >::mutex ( ) const
pure virtual

Internal node mutex.

The role of the mutex is to protect the access to the internal T instance. The data references return by the Mutex methods correspond the node's internal T instance.

Returns
pointer to the internal node mutex

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


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