Fawkes API  Fawkes Development Version
fawkes::FawkesNetworkAspect Class Reference

Thread aspect to participate in the Fawkes Network protocol. More...

#include <>>

Inheritance diagram for fawkes::FawkesNetworkAspect:

Public Member Functions

 FawkesNetworkAspect ()
 Constructor. More...
 
virtual ~FawkesNetworkAspect ()
 Virtual empty Destructor. More...
 
void init_FawkesNetworkAspect (FawkesNetworkHub *fnethub)
 Set the logger. More...
 
- Public Member Functions inherited from fawkes::Aspect
const std::list< const char * > & get_aspects () const
 Get list of aspect names attached to a aspected thread. More...
 

Protected Attributes

FawkesNetworkHubfnethub
 This is the Fawkes network hub member used to access the Fawkes network protocol. More...
 

Additional Inherited Members

- Protected Member Functions inherited from fawkes::Aspect
void add_aspect (const char *name)
 Add an aspect to a thread. More...
 

Detailed Description

Thread aspect to participate in the Fawkes Network protocol.

Give this aspect to your thread to make use of the Fawkes network protocol. The protocol is designed to transport short messages over the network (information and control data). With this aspect you can easily inject messages into the stream and and receive messages from connected clients. The component ID has to be unique. To ensure this have a look at netcomm/fawkes/component_ids.h.

It is guaranteed that if used properly from within plugins that initFawkesNetworkAspect() is called before the thread is started and that you can access the Fawkes network hub via the fnethub member.

In most cases you should implement Thread::init() to register your FawkesNetworkHandler.

Author
Tim Niemueller

Definition at line 35 of file fawkes_network.h.

Constructor & Destructor Documentation

◆ FawkesNetworkAspect()

fawkes::FawkesNetworkAspect::FawkesNetworkAspect ( )

Constructor.

Definition at line 62 of file fawkes_network.cpp.

References fawkes::Aspect::add_aspect().

◆ ~FawkesNetworkAspect()

fawkes::FawkesNetworkAspect::~FawkesNetworkAspect ( )
virtual

Virtual empty Destructor.

Definition at line 68 of file fawkes_network.cpp.

Member Function Documentation

◆ init_FawkesNetworkAspect()

void fawkes::FawkesNetworkAspect::init_FawkesNetworkAspect ( FawkesNetworkHub fnethub)

Set the logger.

It is guaranteed that this is called for a thread having the Fawkes netwok aspect before Thread::start() is called (when running regularly inside Fawkes).

Parameters
fnethubFawkes network hub instance to use for network communication.

Definition at line 81 of file fawkes_network.cpp.

References fnethub.

Referenced by fawkes::FawkesNetworkAspectIniFin::init().

Member Data Documentation

◆ fnethub

FawkesNetworkHub fawkes::FawkesNetworkAspect::fnethub
protected

This is the Fawkes network hub member used to access the Fawkes network protocol.

The logger will remain valid for the whole lifetime of the thread.

Definition at line 44 of file fawkes_network.h.

Referenced by ExampleNetworkThread::finalize(), ExampleNetworkThread::handle_network_message(), ExampleNetworkThread::init(), and init_FawkesNetworkAspect().


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