LIBRCSC Docs
Documentation for HELIOS's BASE LIBRCSC library for RoboCup 2D Simulation League.
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
freeform_message_parser.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_COMMON_FREEFORM_MESSAGE_PARSER_H
33#define RCSC_COMMON_FREEFORM_MESSAGE_PARSER_H
34
35#include <memory>
36#include <string>
37
38namespace rcsc {
39
45public:
46
48 typedef std::shared_ptr< FreeformMessageParser > Ptr;
49
50private:
51
52 const std::string M_type;
53
54 // not used
55 FreeformMessageParser() = delete;
57 FreeformMessageParser & operator=( const FreeformMessageParser & ) = delete;
58
59protected:
60
64 FreeformMessageParser( const std::string & t )
65 : M_type( t )
66 { }
67
68public:
69
73 virtual
75
80 const std::string & type() const
81 {
82 return M_type;
83 }
84
91 virtual
92 int parse( const char * msg ) = 0;
93
94};
95
96}
97
98#endif
abstract freeform message parser
Definition: freeform_message_parser.h:44
std::shared_ptr< FreeformMessageParser > Ptr
pointer type
Definition: freeform_message_parser.h:48
virtual ~FreeformMessageParser()=default
virtual destructor.
const std::string & type() const
get the message type string.
Definition: freeform_message_parser.h:80
FreeformMessageParser(const std::string &t)
protected constructor.
Definition: freeform_message_parser.h:64
virtual int parse(const char *msg)=0
analyzes freeform message.