YANE-Framework Tutorial 1.1.0

examples/mpctcp/src/simplehandler.h

00001 /***************************************************************************
00002  *                                                                         *
00003  * Copyright (C) 2011 by www.nonlinearmpc.com                              *
00004  *                                                                         *
00005  * Authors:                                                                *
00006  *  Thomas Jahn <thomas.jahn@uni-bayreuth.de>                              *
00007  *  Juergen Pannek <juergen.pannek@googlemail.com>                         *
00008  *                                                                         *
00009  ***************************************************************************/
00010 
00011 #ifndef SIMPLEHANDLER_H
00012 #define SIMPLEHANDLER_H
00013 
00014 #include <yane.h>
00015 
00016 namespace yane
00017 {
00018         namespace Model
00019         {
00020                 class Model;
00021         }
00022 
00023         namespace Utils
00024         {
00025                 class DebugMaster;
00026                 class StatisticsMaster;
00027         }
00028 
00029         namespace NetworkedControl
00030         {
00031                 class Cycle;
00032         }
00033 }
00034 
00035 class SimpleSimulator;
00036 
00037 class SimpleHandler : public yane::NetworkedControl::ModelHandlerTCP
00038 {
00039         public:
00040                 SimpleHandler ( yane::Model::Model * model,
00041                         yane::NetworkedControl::Cycle * cycle, int maxseqlength = 100,
00042                         yane::Utils::DebugMaster * dm = 0,
00043                         yane::Utils::StatisticsMaster * sm = 0, int tcpport = 41923,
00044                         int buffersize = 8192 );
00045 
00046                 void setSimulator ( SimpleSimulator * simulator );
00047 
00048         protected:
00049                 virtual void controllerConnected ( );
00050                 virtual void controllerConnecting ( );
00051                 virtual void controllerDisconnected ( );
00052 
00053                 SimpleSimulator * _simulator;
00054                 yane::Utils::StatisticsMaster * _sm;
00055 };
00056 
00057 #endif