handler.h

説明を見る。
00001 // -*-c++-*-
00002 
00008 /*
00009  *Copyright:
00010 
00011  Copyright (C) Hidehisa AKIYAMA
00012 
00013  This code is free software; you can redistribute it and/or
00014  modify it under the terms of the GNU Lesser General Public
00015  License as published by the Free Software Foundation; either
00016  version 2.1 of the License, or (at your option) any later version.
00017 
00018  This library is distributed in the hope that it will be useful,
00019  but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021  Lesser General Public License for more details.
00022 
00023  You should have received a copy of the GNU Lesser General Public
00024  License along with this library; if not, write to the Free Software
00025  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00026 
00027  *EndCopyright:
00028  */
00029 
00031 
00032 #ifndef RCSC_RCG_HANDLER_H
00033 #define RCSC_RCG_HANDLER_H
00034 
00035 #include <rcsc/rcg/types.h>
00036 
00037 #include <string>
00038 
00039 namespace rcsc {
00040 namespace rcg {
00041 
00048 class Handler {
00049 private:
00051     int M_log_version;
00052 
00053 public:
00057     Handler()
00058         : M_log_version( 0 )
00059       { }
00060 
00064     virtual
00065     ~Handler()
00066       { }
00067 
00076     virtual
00077     bool handleLogVersion( const int ver )
00078       {
00079           M_log_version = ver;
00080           return true;
00081       }
00082 
00090     virtual
00091     int logVersion() const
00092       {
00093           return M_log_version;
00094       }
00095 
00101     virtual
00102     bool handleDispInfo( const dispinfo_t & info ) = 0;
00103 
00109     virtual
00110     bool handleShowInfo( const showinfo_t & info ) = 0;
00111 
00117     virtual
00118     bool handleShortShowInfo2( const short_showinfo_t2 & info ) = 0;
00119 
00121 
00127     virtual
00128     bool handleMsgInfo( Int16 board,
00129                         const std::string & msg ) = 0;
00130 
00136     virtual
00137     bool handlePlayMode( char playmode ) = 0;
00138 
00145     virtual
00146     bool handleTeamInfo( const team_t & team_left,
00147                          const team_t & team_right ) = 0;
00148 
00154     virtual
00155     bool handlePlayerType( const player_type_t & type ) = 0;
00156 
00162     virtual
00163     bool handleServerParam( const server_params_t & param ) = 0;
00164 
00170     virtual
00171     bool handlePlayerParam( const player_params_t & param ) = 0;
00172 
00177     virtual
00178     bool handleEOF() = 0;
00179 
00180 
00181     //
00182     // version 4
00183     //
00184 
00191     virtual
00192     bool handleShow( const int time,
00193                      const ShowInfoT & show ) = 0;
00194 
00202     virtual
00203     bool handleMsg( const int time,
00204                     const int board,
00205                     const std::string & msg ) = 0;
00206 
00213     virtual
00214     bool handlePlayMode( const int time,
00215                          const PlayMode pm ) = 0;
00216 
00224     virtual
00225     bool handleTeam( const int time,
00226                      const TeamT & team_l,
00227                      const TeamT & team_r ) = 0;
00228 
00234     virtual
00235     bool handleServerParam( const std::string & msg ) = 0;
00236 
00242     virtual
00243     bool handlePlayerParam( const std::string & msg ) = 0;
00244 
00250     virtual
00251     bool handlePlayerType( const std::string & msg ) = 0;
00252 
00253 };
00254 
00255 
00256 } // end of namespace
00257 } // end of namespace
00258 
00259 #endif

librcscに対してThu May 1 15:41:21 2008に生成されました。  doxygen 1.5.0