Fawkes API  Fawkes Development Version
fawkes::OpenPRSAspectIniFin Class Reference

OpenPRSAspect initializer/finalizer. More...

#include <>>

Inheritance diagram for fawkes::OpenPRSAspectIniFin:

Public Member Functions

 OpenPRSAspectIniFin ()
 Constructor. More...
 
 ~OpenPRSAspectIniFin ()
 Destructor. More...
 
virtual void init (Thread *thread)
 Initialize thread. More...
 
virtual void finalize (Thread *thread)
 Finalize thread. More...
 
void prepare (const std::string &fawkes_host, unsigned short fawkes_port, LockPtr< OpenPRSKernelManager > &openprs_kernel_mgr, OpenPRSServerProxy *openprs_server_proxy, OpenPRSMessagePasserProxy *openprs_mp_proxy)
 Prepare OpenPRS aspect initializer. More...
 
void set_kernel_timeout (float timeout_sec)
 Set timeout for kernel creation. More...
 
- Public Member Functions inherited from fawkes::AspectIniFin
 AspectIniFin (const char *aspect_name) __attribute__((nonnull))
 Constructor. More...
 
virtual ~AspectIniFin ()
 Virtual empty destructor. More...
 
virtual bool prepare_finalize (Thread *thread)
 Default finalize preparation. More...
 
const char * get_aspect_name () const
 Get aspect name. More...
 

Detailed Description

OpenPRSAspect initializer/finalizer.

This initializer/finalizer will provide the OpenPRS node handle to threads with the OpenPRSAspect.

Author
Tim Niemueller

Definition at line 42 of file openprs_inifin.h.

Constructor & Destructor Documentation

◆ OpenPRSAspectIniFin()

fawkes::OpenPRSAspectIniFin::OpenPRSAspectIniFin ( )

Constructor.

Definition at line 44 of file openprs_inifin.cpp.

◆ ~OpenPRSAspectIniFin()

fawkes::OpenPRSAspectIniFin::~OpenPRSAspectIniFin ( )

Destructor.

Definition at line 53 of file openprs_inifin.cpp.

Member Function Documentation

◆ finalize()

void fawkes::OpenPRSAspectIniFin::finalize ( Thread thread)
virtual

Finalize thread.

The aspect for the given thread must be initialized. Use dynamic_cast to cast the thread into the expected aspect class. An exception must be thrown if this fails. If anything fails during initialization of the aspect an Exception must be thrown. This will not prevent the thread from being removed. Use prepare_finalize() to report problems that should prevent the thread from being unloaded.

Parameters
threadthread to finalize

Implements fawkes::AspectIniFin.

Definition at line 113 of file openprs_inifin.cpp.

References fawkes::Thread::name(), and fawkes::OpenPRSAspect::openprs_kernel_name.

◆ init()

void fawkes::OpenPRSAspectIniFin::init ( Thread thread)
virtual

Initialize thread.

The aspect for the given thread must be initialized. Use dynamic_cast to cast the thread into the expected aspect class. An exception must be thrown if this fails. If anything fails during initialization of the aspect an Exception must be thrown.

Parameters
threadthread to initialize

Implements fawkes::AspectIniFin.

Definition at line 61 of file openprs_inifin.cpp.

References fawkes::OpenPRSServerProxy::has_kernel(), fawkes::Thread::name(), fawkes::OpenPRSAspect::openprs, fawkes::OpenPRSAspect::openprs_kernel_mode, fawkes::OpenPRSAspect::openprs_kernel_name, fawkes::OpenPRSAspect::openprs_local_name, fawkes::Time::stamp(), fawkes::OpenPRSComm::transmit_command_f(), and fawkes::OpenPRSAspect::XOPRS.

◆ prepare()

void fawkes::OpenPRSAspectIniFin::prepare ( const std::string &  fawkes_host,
unsigned short  fawkes_port,
LockPtr< OpenPRSKernelManager > &  openprs_kernel_mgr,
OpenPRSServerProxy openprs_server_proxy,
OpenPRSMessagePasserProxy openprs_mp_proxy 
)

Prepare OpenPRS aspect initializer.

Parameters
fawkes_hostHostname where Fawkes is running
fawkes_portTCP port where Fawkes listens on
openprs_kernel_mgrOpenPRS kernel manager
openprs_server_proxyOpenPRS server proxy
openprs_mp_proxyOpenPRS Message Passer proxy

Definition at line 136 of file openprs_inifin.cpp.

Referenced by OpenPRSThread::init().

◆ set_kernel_timeout()

void fawkes::OpenPRSAspectIniFin::set_kernel_timeout ( float  timeout_sec)

Set timeout for kernel creation.

Parameters
timeout_sectimeout in seconds after which kernel creation is assumed to have failed.

Definition at line 159 of file openprs_inifin.cpp.

Referenced by OpenPRSThread::init().


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