Fawkes API
Fawkes Development Version
|
OpenPRSAspect initializer/finalizer. More...
#include <>>
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... | |
![]() | |
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... | |
OpenPRSAspect initializer/finalizer.
This initializer/finalizer will provide the OpenPRS node handle to threads with the OpenPRSAspect.
Definition at line 42 of file openprs_inifin.h.
fawkes::OpenPRSAspectIniFin::OpenPRSAspectIniFin | ( | ) |
Constructor.
Definition at line 44 of file openprs_inifin.cpp.
fawkes::OpenPRSAspectIniFin::~OpenPRSAspectIniFin | ( | ) |
Destructor.
Definition at line 53 of file openprs_inifin.cpp.
|
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.
thread | thread to finalize |
Implements fawkes::AspectIniFin.
Definition at line 113 of file openprs_inifin.cpp.
References fawkes::Thread::name(), and fawkes::OpenPRSAspect::openprs_kernel_name.
|
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.
thread | thread 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.
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.
fawkes_host | Hostname where Fawkes is running |
fawkes_port | TCP port where Fawkes listens on |
openprs_kernel_mgr | OpenPRS kernel manager |
openprs_server_proxy | OpenPRS server proxy |
openprs_mp_proxy | OpenPRS Message Passer proxy |
Definition at line 136 of file openprs_inifin.cpp.
Referenced by OpenPRSThread::init().
void fawkes::OpenPRSAspectIniFin::set_kernel_timeout | ( | float | timeout_sec | ) |
Set timeout for kernel creation.
timeout_sec | timeout in seconds after which kernel creation is assumed to have failed. |
Definition at line 159 of file openprs_inifin.cpp.
Referenced by OpenPRSThread::init().