- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Mers::Executives::DeductiveController::Rtapi::MR::MR_rtapi Class Reference

`#include <MR_rtapi.h>`

Collaboration diagram for Mers::Executives::DeductiveController::Rtapi::MR::MR_rtapi:

[legend]
List of all members.

## Public Member Functions
| MR_rtapi (Mers::Reconfiguration::Discrete::MR_connection *mr_con, RTAPICallback *mr_callback)
virtual | ~MR_rtapi ()
virtual int | queue_state_update (unsigned int state_index, unsigned int value_index)
virtual int | queue_goal (unsigned int goal_var_index, unsigned int value_index)
virtual int | queue_request_MR (void)
## Protected Attributes
Mers::Executives::DeductiveController::Rtapi::ThreadSafeObjectQueue & | thequeue
| The Queue to which all messages are posted.
MR_dispatcher * | dispatcher
Mers::Reconfiguration::Discrete::MR_connection * | themr_con
| The Mode Reconfiguration object that this RTAPI is servicing.
Mers::Executives::DeductiveController::Rtapi::RTAPICallback * | themr_callback
bool | active

## Detailed Description

A real-time queue that interfaces to a Mode Reconfiguration object. This queue is thread-safe and will quickly record any messages for MR and then return. MR will then process the messages on its own thread as it processes the tasks it's been given.

Author:
  Andreas F. Wehowsky

  Paul H. Elliott

Definition at line 50 of file MR_rtapi.h.

## Constructor & Destructor Documentation

MR_rtapi::MR_rtapi | ( | Mers::Reconfiguration::Discrete::MR_connection * | mr_con,
|  | RTAPICallback * | mr_callback |
| ) |  |  |

Creates a new MR RTAPI object.

Parameters:

  | mr_con | The Mode Reconfiguration object that will be used with this queue.
  | mr_callback | The object that will be called when MR has processed messages and has additional information.

Definition at line 32 of file MR_rtapi.cpp.

References active, Mers::Utils::Lang::ReferencedObject::addReference(), dispatcher, themr_callback, themr_con, and thequeue.

Here is the call graph for this function:

MR_rtapi::~MR_rtapi | ( |  | ) | `[virtual]`

Destroys this object.

Definition at line 45 of file MR_rtapi.cpp.

References active, Mers::Executives::DeductiveController::Rtapi::ThreadSafeObjectQueue::enqueue(), Mers::Utils::Lang::ReferencedObject::removeReference(), thequeue, and Mers::Executives::DeductiveController::Rtapi::ThreadSafeObjectQueue::waitForEmpty().

Here is the call graph for this function:

## Member Function Documentation

int MR_rtapi::queue_state_update | ( | unsigned int | state_index,
|  | unsigned int | value_index |
| ) |  |  | `[virtual]`

Queues an update to a state variable.

Parameters:

  | state_index | The unique index of the variable being updated.
  | value_index | The unique index of the new value of the variable.

Definition at line 67 of file MR_rtapi.cpp.

References active, Mers::Executives::DeductiveController::Rtapi::ThreadSafeObjectQueue::enqueue(), and thequeue.

Referenced by Mers::Executives::DeductiveController::DCInterface::post_mode_estimate().

Here is the call graph for this function:

int MR_rtapi::queue_goal | ( | unsigned int | goal_var_index,
|  | unsigned int | value_index |
| ) |  |  | `[virtual]`

Queues an additional goal for MR to achieve. Goals are cumulative between calls to queue_request_MR. Additionally, if no goals are posted between two consecutive queue_request_MR, the previous set of goals are used again. For example. With the sequence:
QG(A) QG(B) QRMR() QG(A) QG(C) QRMR() QRMR() QG(D) QRMR(),
where QG is queue_goal, and QRMR is queue_request_MR, MR will be run on the goals: {A, B}, {A, C}, {A, C}, {D}.

Definition at line 77 of file MR_rtapi.cpp.

References active, Mers::Executives::DeductiveController::Rtapi::ThreadSafeObjectQueue::enqueue(), and thequeue.

Referenced by Mers::Executives::DeductiveController::DCInterface::step().

Here is the call graph for this function:

int MR_rtapi::queue_request_MR | ( | void |  | ) | `[virtual]`

Requests that MR determine an appropriate command to get achieve the current set of goals. This command will be returned via the RTAPICallback.

Definition at line 87 of file MR_rtapi.cpp.

References active, Mers::Executives::DeductiveController::Rtapi::ThreadSafeObjectQueue::enqueue(), and thequeue.

Referenced by Mers::Executives::DeductiveController::DCInterface::requestMR(), and Mers::Executives::DeductiveController::DCInterface::step().

Here is the call graph for this function:

## Member Data Documentation

MR_dispatcher* Mers::Executives::DeductiveController::Rtapi::MR::MR_rtapi::dispatcher`[protected]`

The dispatcher which is responsible for shuttling messages from the queue to MR.

Definition at line 103 of file MR_rtapi.h.

Referenced by MR_rtapi().

Mers::Executives::DeductiveController::Rtapi::RTAPICallback* Mers::Executives::DeductiveController::Rtapi::MR::MR_rtapi::themr_callback`[protected]`

All callbacks in response to MR processing messages are sent to this object.

Definition at line 110 of file MR_rtapi.h.

Referenced by MR_rtapi().

bool Mers::Executives::DeductiveController::Rtapi::MR::MR_rtapi::active`[protected]`

True if the queue is still active. The queue becomes inactive when this object is being deleted and until this object has finished shutting down MR and removing all of the links to the queue.

Definition at line 116 of file MR_rtapi.h.

Referenced by MR_rtapi(), queue_goal(), queue_request_MR(), queue_state_update(), and ~MR_rtapi().

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

- /Users/fpy/titan-1-5-MBARI/Mers/Executives/DeductiveController/Rtapi/MR/MR_rtapi.h
- /Users/fpy/titan-1-5-MBARI/Mers/Executives/DeductiveController/Rtapi/MR/MR_rtapi.cpp