LIBRCSC Docs
Documentation for HELIOS's BASE LIBRCSC library for RoboCup 2D Simulation League.
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
parser_v4.h
Go to the documentation of this file.
1// -*-c++-*-
2
8/*
9 *Copyright:
10
11 Copyright (C) Hidehisa AKIYAMA
12
13 This code is free software; you can redistribute it and/or
14 modify it under the terms of the GNU Lesser General Public
15 License as published by the Free Software Foundation; either
16 version 3 of the License, or (at your option) any later version.
17
18 This library is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with this library; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
27 *EndCopyright:
28 */
29
31
32#ifndef RCSC_RCG_PARSER_V4_H
33#define RCSC_RCG_PARSER_V4_H
34
35#include <rcsc/rcg/parser.h>
36#include <rcsc/rcg/types.h>
37
38#include <string>
39
40namespace rcsc {
41namespace rcg {
42
48 : public Parser {
49public:
50
55 virtual
56 int version() const override
57 {
58 return REC_VERSION_4;
59 }
60
68 virtual
69 bool parse( std::istream & is,
70 Handler & handler ) const override;
71
83 bool parseLine( const int n_line,
84 const std::string & line,
85 Handler & handler ) const;
86
87protected:
88
97 virtual
98 bool parseShow( const int n_line,
99 const std::string & line,
100 Handler & handler ) const;
101
110 bool parseMsg( const int n_line,
111 const std::string & line,
112 Handler & handler ) const;
113
122 bool parsePlayMode( const int n_line,
123 const std::string & line,
124 Handler & handler ) const;
125
134 bool parseTeam( const int n_line,
135 const std::string & line,
136 Handler & handler ) const;
137
146 bool parsePlayerType( const int n_line,
147 const std::string & line,
148 Handler & handler ) const;
149
158 bool parseServerParam( const int n_line,
159 const std::string & line,
160 Handler & handler ) const;
161
170 bool parsePlayerParam( const int n_line,
171 const std::string & line,
172 Handler & handler ) const;
173};
174
175} // end of namespace
176} // end of namespace
177
178#endif
abstract rcg data handler class.
Definition: handler.h:48
rcg v4 parser class
Definition: parser_v4.h:48
bool parsePlayMode(const int n_line, const std::string &line, Handler &handler) const
parse PM_MODE info(playmode)
bool parseServerParam(const int n_line, const std::string &line, Handler &handler) const
parse PARAM_MODE info(server_params_t)
bool parsePlayerParam(const int n_line, const std::string &line, Handler &handler) const
parse PPARAM_MODE info(player_params_t)
bool parseMsg(const int n_line, const std::string &line, Handler &handler) const
parse MSG_MODE info(msg_info_t)
virtual int version() const override
get supported rcg version
Definition: parser_v4.h:56
bool parseLine(const int n_line, const std::string &line, Handler &handler) const
parse data line.
virtual bool parseShow(const int n_line, const std::string &line, Handler &handler) const
parse SHOW_MODE inof, actually short_showinfo_t2
virtual bool parse(std::istream &is, Handler &handler) const override
parse input stream
bool parsePlayerType(const int n_line, const std::string &line, Handler &handler) const
parse PT_MODE info(player_type_t)
bool parseTeam(const int n_line, const std::string &line, Handler &handler) const
parse TEAM_MODE info(team_t * 2)
rcg stream parser interface class
Definition: parser.h:51
abstract rcg parser class Header File.
rcg data format types.
constexpr int REC_VERSION_4
recorded value of rcg v4
Definition: types.h:1139