亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? genericvalues.c

?? uva trilearn的robocup源程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*Copyright (c) 2000-2002, Jelle Kok, University of AmsterdamAll rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the University of Amsterdam nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*//*! \file GenericValues.C<pre><b>File:</b>          GenericValues.C<b>Project:</b>       Robocup Soccer Simulation Team: UvA Trilearn<b>Authors:</b>       Jelle Kok<b>Created:</b>       28/11/2000<b>Last Revision:</b> $ID$<b>Contents:</b>      Code file for classes GenericValueT and GenericValues.               The class GenericValueT contains a pointer to a variable               of a generic type (double, char*, bool, int). This pointer               is associated with a string. The class GenericValues               contains a collection of GenericValueT objects. The member               method implementations for both classes can be found in               this file.</pre><hr size=2><pre><h2><b>Changes</b></h2><b>Date</b>             <b>Author</b>          <b>Comment</b>28/11/2000       Jelle Kok       Initial version created (based on Emiel Corten)30/12/2000       Jelle Kok       Initial documentation written21/05/2001       Remco de Boer   Version including full documentation completed</pre>*/#include "GenericValues.h"#include "Parse.h"           // needed for 'gotoFirstNonSpace'#include <stdio.h>           // needed for 'sprintf'#include <stdlib.h>          // needed for 'free'#include <string>          // needed for 'strdup'#include <ctype.h>           // needed for 'isdigit'#include <fstream>         // needed for 'ifstream'using namespace std;/******************************************************************************//********************   CLASS GENERICVALUET   *********************************//******************************************************************************//*! Constructor for the GenericValueT class. It creates a GenericValueT object    by setting all the private member variables to the values passed to the    constructor.    \param strName a string denoting the name associated with the generic    variable to which the class pointer will point (the variable can be reached    through this name)    \param vAdress a (void) pointer to the actual generic variable    \param t the (generic) type of the variable associated with the class    pointer */GenericValueT::GenericValueT( const char *str, void *vAddr, GenericValueKind t ){  m_strName  = strdup( str ); // strdup needed to allocate right amount of memory  m_vAddress = vAddr;  m_type     = t;}/*! Destructor for the GenericValueT class. It destroys a GenericValueT object    by freeing all memory allocated to it. */GenericValueT::~GenericValueT( ){  if( m_strName )    free( ( char * ) m_strName );}/*! Get method for the 'm_strName' member variable.    \return the name associated with the variable to which the class pointer    points */const char* GenericValueT::getName ( ){  return ( m_strName );}/*! This method sets the variable associated with this GenericValueT object to    the value indicated by the given string argument. The value is always    supplied as a string which is then converted into the right type for this    GenericValueT object.    \param strValue a string denoting the value to which the variable associated    with this GenericValueT object must be set    \return a boolean indicating whether the update was successful */bool GenericValueT::setValue( const char *strValue ){  bool bReturn = true, b = false;  // determine the generic type associated with this GenericValueT  // object and apply the correct conversion of the string argument  switch( m_type )  {    case GENERIC_VALUE_DOUBLE:      *( double * ) m_vAddress = atof( strValue ? strValue : 0 );      break;    case GENERIC_VALUE_STRING:      strcpy( ( char * ) m_vAddress, strValue );      break;    case GENERIC_VALUE_BOOLEAN:      b = false;      if( !strValue )        ;      else if( isdigit( strValue[ 0 ] ) )        b = atoi( strValue ? strValue : 0 );      else if( strcasecmp( strValue, "on"  ) == 0 ||               strcasecmp( strValue, "true") == 0 ||               strcasecmp( strValue, "yes" ) == 0 )        b = true;      *( bool * ) m_vAddress = ( b == true ) ? true : false;      break;    case GENERIC_VALUE_INTEGER:      *( int * ) m_vAddress = atoi( strValue ? strValue : 0 );      break;    default:      bReturn = false;  }  return ( bReturn );}/*! This method determines the value of the variable associated with this    GenericValueT object. The result is converted to a string which is put into    the argument to the method (note that enough memory must be allocated for    this char*). This same string is also returned by the method. This enables    you to use the method as an argument to a function such as 'strcpy'.    \param strValue a string which after the method call will contain the value    of the variable associated with this GenericValueT object    \return a string containing the value of the variable associated with this    GenericValueT object. */char* GenericValueT::getValue( char *strValue ){  // determine the generic type associated with this GenericValueT  // object and apply the correct conversion into a string  switch( m_type )  {    case GENERIC_VALUE_DOUBLE:      sprintf( strValue, "%2f", *( double * ) m_vAddress );      break;    case GENERIC_VALUE_STRING:      sprintf( strValue, "%s", *( char ** ) m_vAddress );      break;    case GENERIC_VALUE_BOOLEAN:      sprintf( strValue, "%d", *( int * ) m_vAddress );      break;    case GENERIC_VALUE_INTEGER:      sprintf( strValue, "%d", *( int * ) m_vAddress );      break;    default:      *strValue = '\0';  }  return ( strValue );}/*! This display method writes the name associated with the variable in this    GenericValueT object together with its value to the output stream indicated    by the first argument to the method. Name and value are separated by the    separator given as the second argument. Note that boolean values are written    as 'true' and 'false'.    \param out the output stream to which the information should be written    \param strSeparator a string representing the separator which should be    written between the name associated with the variable and its value */void GenericValueT::show( ostream& out, const char *strSeparator ){  // write the name associated with the variable in this GenericValueT  // object followed by the separator to the specified output stream  out << m_strName << strSeparator;  // determine the generic type associated with this GenericValueT  // object and write the correct value to the specified output stream  switch( m_type )  {    case GENERIC_VALUE_DOUBLE:      out << *( double * ) m_vAddress;      break;    case GENERIC_VALUE_STRING:      out << ( char * ) m_vAddress;      break;    case GENERIC_VALUE_BOOLEAN:      out << ( ( *( bool * ) m_vAddress == true ) ? "true" : "false");      break;    case GENERIC_VALUE_INTEGER:      out << *( int * ) m_vAddress;      break;    default:      break;  }  out << endl;}/******************************************************************************//********************   CLASS GENERICVALUES   *********************************//******************************************************************************//*! Constructor for the GenericValues class. It creates a GenericValues object.    \param strName a string denoting the name associated with this group of    generic values (this is usually the name of the subclass which contains the    actual generic variables)    \param iMaxValues an integer denoting the number of generic values in the    current collection, i.e. the maximum number that can be stored */GenericValues::GenericValues( char *strName, int iMaxValues ){  m_iValuesTotal = 0;   // total number of values in collection is set to zero  if( strName )       // set the name of the collection    m_strClassName = strdup( strName );  m_iMaxGenericValues = iMaxValues;  // a GenericValues object is a collection of GenericValueT objects  m_values = new GenericValueT*[ iMaxValues ];}/*! Destructor for the GenericValues class. It destroys a GenericValues object    by freeing all memory allocated to it. */GenericValues::~GenericValues( void ){  for( int i = 0 ; i < getValuesTotal( ) ; i++ )    delete m_values[ i ];  delete m_values;  if( m_strClassName )    free( m_strClassName );}/*! Get method for the 'm_strClassName' member variable.    \return the name associated with this group of generic values (this is    usually the name of the subclass which contains the actual variables) */char* GenericValues::getClassName( ){  return ( m_strClassName );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩电影免费一区| 欧美日高清视频| 丰满少妇在线播放bd日韩电影| 日韩激情av在线| 丝袜诱惑亚洲看片| 天天综合色天天综合色h| 午夜精品久久久久久久久| 亚洲丰满少妇videoshd| 午夜精品视频一区| 青青草国产成人99久久| 捆绑调教美女网站视频一区| 91麻豆免费观看| 91天堂素人约啪| 在线一区二区三区四区五区 | 一区二区三区.www| 亚洲精品日韩一| 一区二区三区中文字幕在线观看| 一区二区三区四区亚洲| 亚洲成人三级小说| 美女视频网站黄色亚洲| 国产一区二区三区| 成a人片亚洲日本久久| 色婷婷精品久久二区二区蜜臂av | 精品在线免费视频| 国产精品中文有码| 97成人超碰视| 欧美酷刑日本凌虐凌虐| 精品久久人人做人人爰| 国产精品无人区| 亚洲综合偷拍欧美一区色| 日韩高清一区二区| 国产一区二区三区四区在线观看| 99精品在线观看视频| 欧美亚洲动漫精品| 精品国产露脸精彩对白| 亚洲欧洲精品一区二区三区| 性感美女久久精品| 国产一区二区导航在线播放| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 国产欧美一区二区精品性色| 亚洲欧洲av在线| 青青草97国产精品免费观看| 国产成人精品三级麻豆| 欧美少妇bbb| 日韩专区欧美专区| 国产麻豆91精品| 欧美亚洲一区三区| 久久视频一区二区| 亚洲一卡二卡三卡四卡五卡| 国产在线精品一区二区不卡了| 91色在线porny| 精品国产成人系列| 一区二区三区欧美日| 韩国女主播一区| 欧美日韩三级在线| 国产精品午夜在线| 日本成人中文字幕| 91啪亚洲精品| 久久久久久久久久久久久女国产乱| 亚洲激情五月婷婷| 国产一区二区按摩在线观看| 欧美综合在线视频| 中文在线资源观看网站视频免费不卡| 亚洲成人av一区| 99综合电影在线视频| 精品欧美黑人一区二区三区| 亚洲精品国产第一综合99久久| 国产精品中文有码| 91精品国产黑色紧身裤美女| 亚洲三级电影全部在线观看高清| 九一久久久久久| 欧美老人xxxx18| 一区av在线播放| 99久久综合狠狠综合久久| 精品国产乱码91久久久久久网站| 亚洲18色成人| 91黄色免费看| 亚洲欧美在线视频| 国产91丝袜在线播放九色| 欧美大黄免费观看| 视频在线观看91| 欧美性生交片4| 亚洲另类在线制服丝袜| 成人av资源在线| 国产清纯在线一区二区www| 麻豆一区二区99久久久久| 欧美日韩另类国产亚洲欧美一级| 亚洲美女屁股眼交| av电影天堂一区二区在线| 欧美韩国日本不卡| 国产高清不卡二三区| 欧美精品一区二区三区蜜桃视频| 欧美aⅴ一区二区三区视频| 欧美群妇大交群的观看方式| 亚洲电影欧美电影有声小说| 欧美性videosxxxxx| 亚洲与欧洲av电影| 在线看一区二区| 亚洲一区在线观看网站| 色久优优欧美色久优优| 亚洲精品高清在线观看| 色网站国产精品| 夜夜嗨av一区二区三区网页| 色哟哟国产精品免费观看| 亚洲欧美日韩中文字幕一区二区三区 | 精品少妇一区二区三区日产乱码| 免费高清不卡av| 精品噜噜噜噜久久久久久久久试看 | 青青草原综合久久大伊人精品优势| 欧美日韩免费高清一区色橹橹| 成人激情校园春色| 国产精品美女久久久久aⅴ | 欧美一区二区三区在线电影| 日韩不卡一区二区| 精品成人一区二区三区| 国产精品影音先锋| 国产欧美日韩三级| 99国产精品视频免费观看| 亚洲激情图片一区| 欧美日韩国产精品自在自线| 男人的j进女人的j一区| 精品美女在线播放| 成人综合婷婷国产精品久久蜜臀| 国产精品欧美精品| 欧美在线观看18| 免费高清视频精品| 欧美韩国日本综合| 在线观看视频91| 青青青爽久久午夜综合久久午夜| 精品久久久久久久一区二区蜜臀| 国产69精品久久99不卡| 亚洲欧美日韩国产综合| 欧美裸体一区二区三区| 久99久精品视频免费观看| 国产精品国产三级国产普通话99 | 99热精品一区二区| 亚洲成人av电影| 亚洲精品一区在线观看| 成人av在线一区二区三区| 亚洲成人精品一区| 国产亚洲精品aa午夜观看| 99国产精品久| 蜜臀av一区二区在线免费观看| 欧美经典一区二区| 欧美色综合网站| 国产在线播精品第三| 亚洲综合在线第一页| 久久久一区二区三区捆绑**| 97久久精品人人爽人人爽蜜臀| 日韩精品91亚洲二区在线观看| 国产日产欧产精品推荐色| 欧美日韩一区在线| 国产99久久久精品| 日韩av中文字幕一区二区三区| 国产精品青草综合久久久久99| 欧美伦理影视网| 99视频有精品| 国产在线精品一区二区三区不卡| 亚洲永久免费av| 国产日韩成人精品| 91精品国产综合久久久久久| 99久久综合狠狠综合久久| 蜜桃视频在线观看一区二区| 亚洲精品亚洲人成人网在线播放| 久久亚洲私人国产精品va媚药| 欧美做爰猛烈大尺度电影无法无天| 国产一区二区三区视频在线播放| 亚洲图片自拍偷拍| 国产精品久久久久久久久久久免费看 | 另类欧美日韩国产在线| 亚洲免费观看视频| 欧美国产日韩精品免费观看| 日韩写真欧美这视频| 国产欧美一区二区精品久导航| 欧洲日韩一区二区三区| 成人福利在线看| 国产一区二区成人久久免费影院| 视频一区二区国产| 亚洲精品成人精品456| 国产精品视频线看| 久久亚洲二区三区| 欧美一级精品在线| 欧美日韩国产影片| 91久久久免费一区二区| 成人精品视频一区| 国产精品综合在线视频| 麻豆91免费看| 日韩黄色免费电影| 亚洲成人自拍一区| 夜夜嗨av一区二区三区网页 | 国产麻豆精品久久一二三| 日本人妖一区二区| 日韩精品一卡二卡三卡四卡无卡| 一区二区三区免费在线观看| 中文字幕一区二区三区视频| 国产精品护士白丝一区av| 中文字幕免费不卡| 欧美激情一区不卡| 国产精品视频麻豆| 国产精品高潮呻吟久久|