serializercommonstdv8.cpp

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

CPP
109
字号
// -*-c++-*-/***************************************************************************                            serializercommonstdv8.cc                  Class for serializing data to std v8 clients                             -------------------    begin                : 24-JAN-2003    copyright            : (C) 2003 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 "serializercommonstdv8.h"#include "clangmsg.h"namespace rcss{SerializerCommonStdv8::SerializerCommonStdv8(){}SerializerCommonStdv8::~SerializerCommonStdv8(){}constSerializerCommonStdv8 &SerializerCommonStdv8::instance(){    static SerializerCommonStdv8 ser;    return ser;}voidSerializerCommonStdv8::serializeServerParamBegin( std::ostream & strm ) const{    strm << "(server_param ";}voidSerializerCommonStdv8::serializePlayerParamBegin( std::ostream & strm ) const{    strm << "(player_param ";}voidSerializerCommonStdv8::serializePlayerTypeBegin( std::ostream & strm ) const{    strm << "(player_type ";}voidSerializerCommonStdv8::serializeParam( std::ostream & strm,                                       const std::string & name,                                       const int param ) const{    strm << "(" << name << ' ' << param << ')';}voidSerializerCommonStdv8::serializeParam( std::ostream & strm,                                       const std::string & name,                                       const bool param ) const{    strm << "(" << name << ' ' << param << ')';}voidSerializerCommonStdv8::serializeParam( std::ostream & strm,                                       const std::string & name,                                       const double & param ) const{    strm << "(" << name << ' ' << param << ')';}voidSerializerCommonStdv8::serializeParam( std::ostream & strm,                                       const std::string & name,                                       const std::string & param ) const{    strm << "(" << name << " \"" << param << "\")";}namespace {constSerializerCommon &create(){    return SerializerCommonStdv8::instance();}RegHolder v8 = SerializerCommon::factory().autoReg( &create, 8 );RegHolder v9 = SerializerCommon::factory().autoReg( &create, 9 );RegHolder v10 = SerializerCommon::factory().autoReg( &create, 10 );RegHolder v11 = SerializerCommon::factory().autoReg( &create, 11 );RegHolder v12 = SerializerCommon::factory().autoReg( &create, 12 );RegHolder v13 = SerializerCommon::factory().autoReg( &create, 13 );}}

⌨️ 快捷键说明

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