00001 00002 /*************************************************************************** 00003 * processor.cpp - Fawkes RefBox Processor Pure Virtual Class 00004 * 00005 * Created: Sun Apr 19 19:15:46 2009 (German Open 2009) 00006 * Copyright 2009 Tim Niemueller [www.niemueller.de] 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU Library General Public License for more details. 00019 * 00020 * Read the full text in the LICENSE.GPL file in the doc directory. 00021 */ 00022 00023 #include "processor.h" 00024 00025 /** @class RefBoxProcessor "processor/processor.h" 00026 * Referee Box Communication Processor. 00027 * Classes that implement this interface communicate with a refbox and provide 00028 * information received to a RefBoxStateHandler. 00029 * @author Tim Niemueller 00030 * 00031 * @fn bool RefBoxProcessor::check_connection() 00032 * Check if the connection is alive and reconnect. 00033 * If the connection is not alive the processor shall do a single attempt 00034 * to reestablish the connection. 00035 * @return true if the connection is established or could be recovered, false 00036 * otherwise. 00037 * 00038 * @fn void RefBoxProcessor::refbox_process() 00039 * Process incoming refbox communication. 00040 * This shall process a (limited number of) communication packets received 00041 * from the particular refbox at hand. 00042 */ 00043 00044 /** Pure virtual destructor. */ 00045 RefBoxProcessor::~RefBoxProcessor() 00046 { 00047 } 00048 00049 /** Set handler. 00050 * @param rsh Ref box state handler used to process incoming information 00051 */ 00052 void 00053 RefBoxProcessor::set_handler(RefBoxStateHandler *rsh) 00054 { 00055 _rsh = rsh; 00056 }