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

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

?? genericvalues.c

?? 機器足球2D比賽程序 對trlen_base_2002的改進
?? 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.h>          // needed for 'strdup'#include <ctype.h>           // needed for 'isdigit'#include <fstream>           // needed for 'ifstream'/******************************************************************************//********************   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一区二区三区免费野_久草精品视频
91亚洲永久精品| 91麻豆自制传媒国产之光| 亚洲精品va在线观看| 亚洲欧洲无码一区二区三区| 久久久欧美精品sm网站| 欧美一区二区三区在线观看| 51精品秘密在线观看| 欧美精品日日鲁夜夜添| 欧美精品久久久久久久多人混战| 在线精品视频免费播放| 欧美精品日韩一本| 日韩一区二区三区视频在线观看| 欧美一区二区网站| 国产亚洲欧洲一区高清在线观看| 国产午夜一区二区三区| 综合精品久久久| 亚洲亚洲精品在线观看| 蜜臀精品一区二区三区在线观看| 日本不卡视频一二三区| 国产91精品一区二区麻豆亚洲| 成人午夜精品一区二区三区| 99国产精品久| 日韩一区二区免费视频| 国产精品欧美一区喷水| 亚洲免费在线观看| 另类综合日韩欧美亚洲| 成人的网站免费观看| 欧美色图天堂网| 国产片一区二区| 亚洲一区在线免费观看| 国产主播一区二区三区| 色综合天天综合狠狠| 精品精品国产高清一毛片一天堂| 欧美激情在线一区二区| 亚欧色一区w666天堂| 国产成人免费视频| 欧美日韩亚洲综合一区| 国产精品妹子av| 免费视频最近日韩| 色综合天天综合在线视频| 日韩视频在线观看一区二区| 国产精品久久久久久久久快鸭 | 色哟哟一区二区在线观看| 欧美伦理电影网| 中文字幕欧美区| 日韩av电影一区| av电影在线观看完整版一区二区| 欧美久久久久久久久| 欧美国产综合色视频| 日本麻豆一区二区三区视频| 粉嫩aⅴ一区二区三区四区五区| 在线观看网站黄不卡| 国产精品伦一区二区三级视频| 午夜精品福利一区二区三区av | 国产成人精品一区二区三区四区 | 成人av在线播放网址| 日韩一级片在线观看| 亚洲码国产岛国毛片在线| 久久av资源站| 欧美一区二区免费视频| 一区av在线播放| 色一区在线观看| 亚洲日本护士毛茸茸| 不卡av免费在线观看| 国产精品网站在线| 国产精品系列在线播放| 26uuu色噜噜精品一区| 捆绑紧缚一区二区三区视频 | 2023国产精品视频| 日韩av中文在线观看| 777欧美精品| 日本人妖一区二区| 欧美一卡2卡3卡4卡| 日韩国产欧美在线视频| 6080国产精品一区二区| 婷婷久久综合九色国产成人| 欧美片在线播放| 青青草伊人久久| 精品剧情在线观看| 免费一级片91| 国产亚洲精品资源在线26u| 国产毛片精品一区| 国产精品视频一二三区| 成人爱爱电影网址| 亚洲欧美在线观看| 欧美在线观看视频一区二区 | 成人免费av在线| 亚洲欧洲精品天堂一级 | 美女www一区二区| 精品伦理精品一区| 成人精品一区二区三区中文字幕| 中文字幕第一页久久| 97超碰欧美中文字幕| 亚洲国产日韩综合久久精品| 69堂亚洲精品首页| 国产伦精一区二区三区| 国产精品动漫网站| 在线欧美一区二区| 青草国产精品久久久久久| 精品国产一区久久| 波多野结衣中文一区| 天堂久久一区二区三区| 精品国产凹凸成av人导航| 成人av片在线观看| 日本欧美在线看| 国产精品污网站| 7777女厕盗摄久久久| 国产精品影视网| 五月婷婷久久综合| 国产日韩欧美在线一区| 欧美性大战久久久久久久蜜臀| 蜜桃在线一区二区三区| 国产精品国产自产拍在线| 欧美男人的天堂一二区| 91小视频免费看| 亚洲国产裸拍裸体视频在线观看乱了 | 韩国av一区二区三区四区| 国产精品高潮呻吟| 日韩精品在线一区| 欧美性感一区二区三区| 国产98色在线|日韩| 奇米影视一区二区三区小说| 亚洲欧美日韩精品久久久久| 精品国产sm最大网站免费看| 欧美探花视频资源| 不卡一区中文字幕| 久久精品av麻豆的观看方式| 一区二区三区欧美在线观看| 337p日本欧洲亚洲大胆色噜噜| 91成人网在线| gogo大胆日本视频一区| 麻豆成人av在线| 亚洲国产精品久久久男人的天堂| 国产精品美女久久福利网站| 精品对白一区国产伦| 欧美日本精品一区二区三区| 91丝袜美腿高跟国产极品老师| 国产一区二区三区| 男人的j进女人的j一区| 午夜欧美视频在线观看| 亚洲一区在线观看免费观看电影高清| 国产精品天美传媒沈樵| 久久亚洲春色中文字幕久久久| 欧美伦理电影网| 这里只有精品免费| 欧美精选午夜久久久乱码6080| 91福利在线观看| 欧美中文字幕不卡| 欧美日韩日日骚| 欧美性三三影院| 欧美日韩精品一区二区三区| 欧美日韩色综合| 欧美老人xxxx18| 欧美精品高清视频| 欧美一级黄色录像| 日韩欧美一级特黄在线播放| 欧美一级理论片| 久久免费看少妇高潮| 欧美国产精品专区| 日韩码欧中文字| 亚洲曰韩产成在线| 天堂久久久久va久久久久| 免费观看日韩电影| 黑人巨大精品欧美一区| 国产老肥熟一区二区三区| 国产精品一区二区在线播放| 成人丝袜视频网| 色一情一伦一子一伦一区| 色婷婷综合中文久久一本| 欧美伊人精品成人久久综合97| 欧美日韩免费电影| 日韩限制级电影在线观看| 久久色在线视频| 中文字幕一区二区三区色视频| 一区二区三区色| 免费av网站大全久久| 国产成人亚洲综合色影视| 91一区二区在线观看| 欧美一卡二卡三卡| 国产精品久99| 日韩经典中文字幕一区| 国产一区二区三区四区五区美女| 成人精品视频一区二区三区尤物| 99精品1区2区| 欧美一区二区三区的| 国产精品久久久久久久久晋中| 一区二区成人在线视频| 激情丁香综合五月| 一本大道久久a久久综合婷婷| 9191成人精品久久| 国产精品乱码一区二区三区软件| 亚洲国产aⅴ成人精品无吗| 国产在线精品视频| 欧美日韩一区二区三区视频| 国产亚洲欧洲997久久综合| 丝袜美腿亚洲综合| 99视频一区二区| 久久综合九色综合欧美亚洲| 亚洲精品乱码久久久久久| 精品亚洲porn|