serializerplayerstdv7.cpp

来自「2009 ROBOCUP 仿真2DSERVER 源码」· C++ 代码 · 共 191 行

CPP
191
字号
// -*-c++-*-/***************************************************************************                            serializerplayerstdv7.cc                  Class for serializing data to std v7 players                             -------------------    begin                : 27-MAY-2002    copyright            : (C) 2002 by The RoboCup Soccer Server                           Maintenance Group.    email                : sserver-admin@lists.sourceforge.net***************************************************************************//*************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU LGPL as published by the Free Software  * *   Foundation; either version 2 of the License, or (at your option) any  * *   later version.                                                        * *                                                                         * ***************************************************************************/#include "serializerplayerstdv7.h"#include "clangmsg.h"namespace rcss {SerializerPlayerStdv7::SerializerPlayerStdv7( const SerializerCommon & common )    : SerializerPlayerStdv1( common ){}SerializerPlayerStdv7::~SerializerPlayerStdv7(){}constSerializerPlayerStdv7 *SerializerPlayerStdv7::instance(){    rcss::SerializerCommon::Creator cre;    if ( ! rcss::SerializerCommon::factory().getCreator( cre, 7 ) )    {        return NULL;    }    static SerializerPlayerStdv7 ser( cre() );    return &ser;}voidSerializerPlayerStdv7::serializeCoachAudio( std::ostream & strm,                                            const int time,                                            const std::string & name,                                            const char * msg ) const{    strm << "(hear " << time << ' '         << name << " \"" << msg << "\")";}voidSerializerPlayerStdv7::serializeCoachStdAudio( std::ostream & strm,                                               const int time,                                               const std::string & name,                                               const rcss::clang::Msg & msg ) const{    strm << "(hear " << time << ' '         << name << ' ' << msg << ')';}voidSerializerPlayerStdv7::serializeSelfAudio( std::ostream & strm,                                           const int time,                                           const char * msg ) const{    strm << "(hear " << time << " self \""         << msg << "\")";}voidSerializerPlayerStdv7::serializePlayerAudio( std::ostream & strm,                                             const int time,                                             const double & dir,                                             const char * msg ) const{    strm << "(hear " << time << ' '         << dir << " \"" << msg << "\")";}voidSerializerPlayerStdv7::serializeServerParamBegin( std::ostream & strm ) const{    strm << "(server_param";}voidSerializerPlayerStdv7::serializeServerParamEnd( std::ostream & strm ) const{    strm << ')';}voidSerializerPlayerStdv7::serializePlayerParamBegin( std::ostream& strm ) const{    strm << "(player_param";}voidSerializerPlayerStdv7::serializePlayerParamEnd( std::ostream & strm ) const{    strm << ")";}voidSerializerPlayerStdv7::serializePlayerTypeBegin( std::ostream & strm ) const{    strm << "(player_type";}voidSerializerPlayerStdv7::serializePlayerTypeEnd( std::ostream & strm ) const{    strm << ')';}voidSerializerPlayerStdv7::serializeParam( std::ostream & strm,                                       const int param ) const{    strm << ' ' << param;}voidSerializerPlayerStdv7::serializeParam( std::ostream & strm,                                       const unsigned int param ) const{    strm << ' ' << param;}voidSerializerPlayerStdv7::serializeParam( std::ostream & strm,                                       const bool param ) const{    strm << ' ' << param;}voidSerializerPlayerStdv7::serializeParam( std::ostream & strm,                                       const double & param ) const{    strm << ' ' << param;}voidSerializerPlayerStdv7::serializeParam( std::ostream & strm,                                       const std::string & param ) const{    strm << ' ' << param;}voidSerializerPlayerStdv7::serializeChangePlayer( std::ostream & strm,                                              const int unum ) const{    strm << "(change_player_type "         << unum << ')';}voidSerializerPlayerStdv7::serializeChangePlayer( std::ostream & strm,                                              const int unum,                                              const int type ) const{    strm << "(change_player_type "         << unum << ' ' << type << ')';}namespace {constSerializerPlayer *create(){    return SerializerPlayerStdv7::instance();}RegHolder v7 = SerializerPlayer::factory().autoReg( &create, 7 );}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?