reader.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_READER_H
00033 #define RCSC_RCG_READER_H
00034 
00035 #include <rcsc/rcg/holder.h>
00036 #include <rcsc/rcg/handler.h>
00037 #include <rcsc/rcg/types.h>
00038 
00039 #include <string>
00040 
00041 namespace rcsc {
00042 namespace rcg {
00043 
00048 class Reader
00049     : public Handler {
00050 private:
00051 
00053     Holder & M_holder;
00054 
00056     Reader();
00058     Reader( const Reader & );
00060     Reader & operator=( const Reader & );
00061 
00062 public:
00069     explicit
00070     Reader( Holder & holder )
00071         : M_holder( holder )
00072       { }
00073 
00077     virtual
00078     ~Reader()
00079       { }
00080 
00081     virtual
00082     bool handleLogVersion( const int ver )
00083       {
00084           return M_holder.setLogVersion( ver );
00085       }
00086 
00094     virtual
00095     bool handleDispInfo( const dispinfo_t & info )
00096       {
00097           return M_holder.addDispInfo( info );
00098       }
00099 
00107     virtual
00108     bool handleShowInfo( const showinfo_t & info )
00109       {
00110           return M_holder.addShowInfo( info );
00111       }
00112 
00120     virtual
00121     bool handleShortShowInfo2( const short_showinfo_t2 & info )
00122       {
00123           return M_holder.addShortShowInfo2( info );
00124       }
00125 
00132     virtual
00133     bool handleMsgInfo( Int16 board,
00134                         const std::string & msg )
00135       {
00136           return M_holder.addMsgInfo( board, msg );
00137       }
00138 
00144     virtual
00145     bool handlePlayMode( char playmode )
00146       {
00147           return M_holder.addPlayMode( playmode );
00148       }
00149 
00156     virtual
00157     bool handleTeamInfo( const team_t & team_left,
00158                          const team_t & team_right )
00159       {
00160           return M_holder.addTeamInfo( team_left, team_right );
00161       }
00162 
00168     virtual
00169     bool handlePlayerType( const player_type_t & type )
00170       {
00171           return M_holder.addPlayerType( type );
00172       }
00173 
00179     virtual
00180     bool handleServerParam( const server_params_t & param )
00181       {
00182           return M_holder.addServerParam( param );
00183       }
00184 
00190     virtual
00191     bool handlePlayerParam( const player_params_t & param )
00192       {
00193           return M_holder.addPlayerParam( param );
00194       }
00195 
00202     virtual
00203     bool handleEOF()
00204       {
00205           return true;
00206       }
00207 
00208 
00209     //
00210     // version 4
00211     //
00212 
00219     virtual
00220     bool handleShow( const int time,
00221                      const ShowInfoT & show )
00222       {
00223           return M_holder.addShow( time, show );
00224       }
00225 
00233     virtual
00234     bool handleMsg( const int time,
00235                     const int board,
00236                     const std::string & msg )
00237       {
00238           return M_holder.addMsg( time, board, msg );
00239       }
00240 
00247     virtual
00248     bool handlePlayMode( const int time,
00249                          const PlayMode pm )
00250       {
00251           return M_holder.addPlayMode( time, pm );
00252       }
00253 
00261     virtual
00262     bool handleTeam( const int time,
00263                      const TeamT & team_l,
00264                      const TeamT & team_r )
00265       {
00266           return M_holder.addTeam( time, team_l, team_r );
00267       }
00268 
00274     virtual
00275     bool handleServerParam( const std::string & msg )
00276       {
00277           return M_holder.addServerParam( msg );
00278       }
00279 
00285     virtual
00286     bool handlePlayerParam( const std::string & msg )
00287       {
00288           return M_holder.addPlayerParam( msg );
00289       }
00290 
00296     virtual
00297     bool handlePlayerType( const std::string & msg )
00298       {
00299           return M_holder.addPlayerType( msg );
00300       }
00301 
00302 };
00303 
00304 } // end of namespace
00305 } // end of namespace
00306 
00307 #endif

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