MIRA
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
FrameworkGraph< NodeMixin, AuthorityNodeMixin, ChannelNodeMixin, NamespaceNodeMixin, FrameworkNodeMixin > Class Template Reference

Represents the whole computation graph with all known units/authorities and channels within their namespaces. More...

#include <fw/FrameworkGraph.h>

Inheritance diagram for FrameworkGraph< NodeMixin, AuthorityNodeMixin, ChannelNodeMixin, NamespaceNodeMixin, FrameworkNodeMixin >:
Inheritance graph
[legend]

Classes

class  AuthorityNode
 Represents a single authority in the framwork computation graph. More...
 
class  ChannelNode
 Represents a single channel in the framwork computation graph. More...
 
class  FrameworkNode
 Represents a framework in the framework computation graph. More...
 
class  NamespaceNode
 Represents a namespace in the framework computation graph within the overall namespace hierarchy. More...
 
class  Node
 Base class for all nodes in the framework computation graph. More...
 

Public Types

typedef boost::shared_ptr< NodeNodePtr
 
typedef boost::shared_ptr< ChannelNodeChannelNodePtr
 
typedef boost::shared_ptr< AuthorityNodeAuthorityNodePtr
 
typedef boost::shared_ptr< NamespaceNodeNamespaceNodePtr
 
typedef boost::shared_ptr< FrameworkNodeFrameworkNodePtr
 

Public Member Functions

 FrameworkGraph ()
 Creates an emtpy framework graph object. More...
 
 FrameworkGraph (FrameworkGraph &&other) noexcept
 
FrameworkGraphoperator= (FrameworkGraph &&other) noexcept
 
void swap (FrameworkGraph &other)
 
boost::mutex & mutex ()
 
bool discover (boost::function< void()> changeCb=boost::function< void()>())
 Discovers the whole structure of all connected frameworks with its authorities, channels, services, etc. More...
 
std::list< NodePtrgetNodes ()
 Returns all channel and authority nodes. More...
 
std::list< ChannelNodePtr > & getChannels ()
 Returns all channel nodes. More...
 
std::list< AuthorityNodePtr > & getAuthorities ()
 Returns all authority nodes. More...
 
std::list< NamespaceNodePtr > & getNamespaces ()
 Returns all namespace nodes. More...
 
std::list< FrameworkNodePtr > & getFrameworks ()
 Returns all framework nodes. More...
 
NamespaceNodePtr getRootNamespace ()
 Returns the root namespace node. More...
 
void integrateNamespaceNode (NamespaceNodePtr node)
 inserts a new namespace node and reparents the existing namespace nodes, if necessary. More...
 

Protected Member Functions

template<typename Container , typename Key >
Container::value_type findPtr (Container &c, const Key &key)
 

Protected Attributes

boost::mutex mMutex
 
std::list< AuthorityNodePtrmAuthorities
 
std::list< ChannelNodePtrmChannels
 
std::list< NamespaceNodePtrmNamespaces
 
std::list< FrameworkNodePtrmFrameworks
 
NamespaceNodePtr mRootNamespace
 
bool mGraphHasChanged
 

Detailed Description

template<typename NodeMixin = void, typename AuthorityNodeMixin = void, typename ChannelNodeMixin = void, typename NamespaceNodeMixin = void, typename FrameworkNodeMixin = void>
class mira::FrameworkGraph< NodeMixin, AuthorityNodeMixin, ChannelNodeMixin, NamespaceNodeMixin, FrameworkNodeMixin >

Represents the whole computation graph with all known units/authorities and channels within their namespaces.

Each such component is represented as graph node. For each such node a separate class is used. For each node class, the user can specify "mixin" classes to add additional members to the nodes. The Mixins are specified as template parameters:

After you created an instance of this FrameworkGraph class, you can call the discover() method to collect all information about the framework computation graph. The discover() method can also be called multiple times to update the graph and the contained nodes.

Note that this class is used to collect the information on the computation network graph only. It is used for visualization purposes and to obtain the overall structure of the computation graph in a "human comprehensible format". This class is NOT intended to store any information that is required by the runtime components! Internally, all the information is distributed in different components.

Member Typedef Documentation

◆ NodePtr

typedef boost::shared_ptr<Node> NodePtr

◆ ChannelNodePtr

typedef boost::shared_ptr<ChannelNode> ChannelNodePtr

◆ AuthorityNodePtr

typedef boost::shared_ptr<AuthorityNode> AuthorityNodePtr

◆ NamespaceNodePtr

typedef boost::shared_ptr<NamespaceNode> NamespaceNodePtr

◆ FrameworkNodePtr

typedef boost::shared_ptr<FrameworkNode> FrameworkNodePtr

Constructor & Destructor Documentation

◆ FrameworkGraph() [1/2]

FrameworkGraph ( )
inline

Creates an emtpy framework graph object.

◆ FrameworkGraph() [2/2]

FrameworkGraph ( FrameworkGraph< NodeMixin, AuthorityNodeMixin, ChannelNodeMixin, NamespaceNodeMixin, FrameworkNodeMixin > &&  other)
inlinenoexcept

Member Function Documentation

◆ operator=()

FrameworkGraph& operator= ( FrameworkGraph< NodeMixin, AuthorityNodeMixin, ChannelNodeMixin, NamespaceNodeMixin, FrameworkNodeMixin > &&  other)
inlinenoexcept

◆ swap()

void swap ( FrameworkGraph< NodeMixin, AuthorityNodeMixin, ChannelNodeMixin, NamespaceNodeMixin, FrameworkNodeMixin > &  other)
inline

◆ mutex()

boost::mutex& mutex ( )
inline

◆ discover()

bool discover ( boost::function< void()>  changeCb = boost::function<void()>())
inline

Discovers the whole structure of all connected frameworks with its authorities, channels, services, etc.

Returns true, if the graph has changed, otherwise false. The optional parameter allows to specify a callback that is called from time to time during the discovery process, whenever changes in the graph have been observed.

◆ getNodes()

std::list<NodePtr> getNodes ( )
inline

Returns all channel and authority nodes.

◆ getChannels()

std::list<ChannelNodePtr>& getChannels ( )
inline

Returns all channel nodes.

◆ getAuthorities()

std::list<AuthorityNodePtr>& getAuthorities ( )
inline

Returns all authority nodes.

◆ getNamespaces()

std::list<NamespaceNodePtr>& getNamespaces ( )
inline

Returns all namespace nodes.

◆ getFrameworks()

std::list<FrameworkNodePtr>& getFrameworks ( )
inline

Returns all framework nodes.

◆ getRootNamespace()

NamespaceNodePtr getRootNamespace ( )
inline

Returns the root namespace node.

◆ integrateNamespaceNode()

void integrateNamespaceNode ( NamespaceNodePtr  node)
inline

inserts a new namespace node and reparents the existing namespace nodes, if necessary.

◆ findPtr()

Container::value_type findPtr ( Container &  c,
const Key &  key 
)
inlineprotected

Member Data Documentation

◆ mMutex

boost::mutex mMutex
protected

◆ mAuthorities

std::list<AuthorityNodePtr> mAuthorities
protected

◆ mChannels

std::list<ChannelNodePtr> mChannels
protected

◆ mNamespaces

std::list<NamespaceNodePtr> mNamespaces
protected

◆ mFrameworks

std::list<FrameworkNodePtr> mFrameworks
protected

◆ mRootNamespace

NamespaceNodePtr mRootNamespace
protected

◆ mGraphHasChanged

bool mGraphHasChanged
protected

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