Fawkes API  Fawkes Development Version
fawkes::OpenPRSAspect Class Reference

OpenPRS kernel creation and communication aspect. More...

#include <>>

Inheritance diagram for fawkes::OpenPRSAspect:

Public Types

enum  Mode { OPRS, XOPRS }
 OPRS kernel operation mode. More...
 

Public Member Functions

 OpenPRSAspect (const char *kernel_name, Mode mode=OPRS, const char *local_name=NULL)
 Constructor. More...
 
virtual ~OpenPRSAspect ()
 Virtual empty destructor. More...
 
void add_openprs_data_path (const std::string &path)
 Add an OpenPRS data path. More...
 
void set_openprs_gdb_delay (const bool enable_gdb_delay)
 Enable/disable GDB delay. 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

LockPtr< OpenPRSCommopenprs
 OpenPRS kernel communication wrapper. More...
 
const std::string openprs_kernel_name
 The name of the kernel created for this thread. More...
 
const Mode openprs_kernel_mode
 The kernel mode, can be OPRS or XOPRS (with graphical interface). More...
 
const std::string openprs_local_name
 The local message passer name for communication. More...
 

Friends

class OpenPRSAspectIniFin
 

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

OpenPRS kernel creation and communication aspect.

This aspect allows access to a specific OpenPRS context through the OpenPRSKernel communication wrapper. The context is created if it does not already exist.

Author
Tim Niemueller

Definition at line 39 of file openprs.h.

Member Enumeration Documentation

◆ Mode

OPRS kernel operation mode.

Enumerator
OPRS 

command line mode

XOPRS 

graphical mode

Definition at line 45 of file openprs.h.

Constructor & Destructor Documentation

◆ OpenPRSAspect()

fawkes::OpenPRSAspect::OpenPRSAspect ( const char *  kernel_name,
OpenPRSAspect::Mode  mode = OPRS,
const char *  local_name = NULL 
)

Constructor.

Parameters
kernel_namethe name of the OpenPRS kernel to connect to. The context may not exist, yet.
modeset to XOPRS to run kernel with graphical user interface, OPRS to run headless (default)
local_namelocal name to register with to the message passer. If NULL will be set to "fawkes-|kernel_name|" (where |kernel_name| will be replaced by the value of kernel_name).

Definition at line 68 of file openprs.cpp.

References fawkes::Aspect::add_aspect(), and openprs_local_name.

◆ ~OpenPRSAspect()

fawkes::OpenPRSAspect::~OpenPRSAspect ( )
virtual

Virtual empty destructor.

Definition at line 81 of file openprs.cpp.

Member Function Documentation

◆ add_openprs_data_path()

void fawkes::OpenPRSAspect::add_openprs_data_path ( const std::string &  path)

Add an OpenPRS data path.

The paths are added to the kernel on intialization and are then searched when including and loading files. Note that this method may only be called in the constructor, i.e. before the aspect is initialized.

Parameters
pathpath to add to search list

Definition at line 94 of file openprs.cpp.

References openprs.

Referenced by OpenPRSAgentThread::OpenPRSAgentThread().

◆ set_openprs_gdb_delay()

void fawkes::OpenPRSAspect::set_openprs_gdb_delay ( const bool  enable_gdb_delay)

Enable/disable GDB delay.

This can be used to order mod_utils to wait for a few seconds to allow for connecting to the OPRS kernel before it is actually running.

Parameters
enable_gdb_delaytrue to enable delay, false to disable (default)

Definition at line 109 of file openprs.cpp.

References openprs.

Referenced by OpenPRSAgentThread::OpenPRSAgentThread().

Member Data Documentation

◆ openprs

fawkes:LockPtr< OpenPRSKernel > fawkes::OpenPRSAspect::openprs
protected

◆ openprs_kernel_mode

const Mode fawkes::OpenPRSAspect::openprs_kernel_mode
protected

The kernel mode, can be OPRS or XOPRS (with graphical interface).

Definition at line 59 of file openprs.h.

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

◆ openprs_kernel_name

const std::string fawkes::OpenPRSAspect::openprs_kernel_name
protected

◆ openprs_local_name

const std::string fawkes::OpenPRSAspect::openprs_local_name
protected

The local message passer name for communication.

Definition at line 60 of file openprs.h.

Referenced by fawkes::OpenPRSAspectIniFin::init(), and OpenPRSAspect().


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