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

# /Users/fpy/titan-1-5-MBARI/Mers/Executives/DeductiveController/Rtapi/ME/ME_dispatcher.h

    00001
    00002 //
    00003 // Copyright (c) 2004           Model-based Embedded and Robotic Systems Group
    00004 // All Rights Reserved          Massachusetts Institute of Technology
    00005 //
    00006 // This software is provided as is. Model-based Embedded and Robotic Systems
    00007 // (MERS) group does not assume any responsibility.
    00008 //
    00009 // Organization:        Model-based Embedded and Robotic Systems Group
    00010 //                                      Massachusetts Institute of Technology
    00011 //
    00013
    00014 #ifndef _ME_DISPATCHER_H
    00015 #define _ME_DISPATCHER_H
    00016
    00017 #include <Mers/Executives/DeductiveController/Rtapi/ThreadSafeObjectQueue.h>
    00018 #include <Mers/Executives/DeductiveController/Rtapi/RTAPICallback.h>
    00019 #include <Mers/Executives/DeductiveController/Rtapi/RTAPIMessage.h>
    00020 #include <Mers/Estimation/Discrete/ME_connection.h>
    00021 #include <Mers/Executives/DeductiveController/Rtapi/MultiThreadedObject.h>
    00022
    00023 namespace Mers {
    00024         namespace Executives {
    00025                 namespace DeductiveController {
    00026                         namespace Rtapi {
    00027                                 namespace ME {
    00028
    00029                                         /*
    00030                                          * The LivingstoneDispatcher object runs in a separate
    00031                                          * thread.  As implied, it takes messages from the queue
    00032                                          * (when the queue is not empty or locked -- this is
    00033                                          * monitored by the guarded queue type ) and invokes a
    00034                                          * corresponding Livingstone engine function.
    00035                                          *
    00036                                          * @author Andreas F. Wehowsky
    00037                                          *
    00038                                          * @author Paul H. Elliott
    00039                                          */
    00040                                         class ME_dispatcher : public MultiThreadedObject
    00041                                         {
    00042
    00043                                         public:
    00044                                                 ME_dispatcher(Mers::Executives::DeductiveController::Rtapi::ThreadSafeObjectQueue * queue,
    00045                                                         Mers::Estimation::Discrete::ME_connection * syst,
    00046                                                         Mers::Executives::DeductiveController::Rtapi::RTAPICallback * inrep);
    00047                                                 virtual ~ME_dispatcher();
    00048
    00049
    00050                                         protected:
    00051                                                 // hard-coded real-time command execution
    00052
    00053                                                 int parse_msg(Mers::Executives::DeductiveController::Rtapi::RTAPIMessage *msg);
    00054                                                 virtual void * run();
    00055
    00056                                                 // thread cleanup handler for reporting
    00057                                                 static void cleanup_reporting(void *arg);
    00058
    00059
    00060                                         protected:
    00061                                                 // user-defined callback functions
    00062                                                 Mers::Executives::DeductiveController::Rtapi::RTAPICallback * meCallback;
    00063
    00064                                                 Mers::Executives::DeductiveController::Rtapi::ThreadSafeObjectQueue * thequeue;
    00065                                                 Mers::Estimation::Discrete::ME_connection * thesystem;
    00066                                         };
    00067                                 }
    00068                         }
    00069                 }
    00070         }
    00071 }
    00072
    00073
    00074
    00075 #endif