Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * msl2010.h - Fawkes mid-size refbox 2010 protocol repeater 00004 * 00005 * Created: Wed Apr 01 10:36:08 2009 00006 * Copyright 2009 Stefan Schiffer [stefanschiffer.de] 00007 * 2010 Tim Niemueller [www.niemueller.de] 00008 * 00009 ****************************************************************************/ 00010 00011 /* This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Library General Public License for more details. 00020 * 00021 * Read the full text in the LICENSE.GPL file in the doc directory. 00022 */ 00023 00024 #ifndef __PLUGINS_REFBOXCOMM_PROCESSOR_MSL2010_H_ 00025 #define __PLUGINS_REFBOXCOMM_PROCESSOR_MSL2010_H_ 00026 00027 #include "processor.h" 00028 #include "state_handler.h" 00029 00030 #include <cstddef> 00031 00032 namespace fawkes { 00033 class MulticastDatagramSocket; 00034 class Logger; 00035 } 00036 00037 namespace xmlpp { 00038 class DomParser; 00039 class Node; 00040 } 00041 00042 class Msl2010RefBoxProcessor : public RefBoxProcessor 00043 { 00044 public: 00045 Msl2010RefBoxProcessor(fawkes::Logger *logger, 00046 const char *refbox_host, unsigned short int refbox_port); 00047 ~Msl2010RefBoxProcessor(); 00048 00049 bool check_connection(); 00050 void refbox_process(); 00051 00052 private: 00053 void process_string(char *buf, size_t len); 00054 void reconnect(); 00055 00056 private: 00057 fawkes::Logger *__logger; 00058 fawkes::MulticastDatagramSocket *__s; 00059 00060 unsigned int __score_cyan; 00061 unsigned int __score_magenta; 00062 00063 const char *__name; 00064 00065 bool __quit; 00066 bool __connection_died; 00067 00068 char *__refbox_host; 00069 unsigned short int __refbox_port; 00070 00071 00072 xmlpp::DomParser *dom; 00073 xmlpp::Node *root; 00074 00075 }; 00076 00077 #endif