亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲激情自拍偷拍| 久久伊人中文字幕| 日韩欧美一二三| 国产农村妇女毛片精品久久麻豆 | 亚洲一区二区三区美女| 国产综合久久久久久鬼色| 欧美日韩在线三级| 中文字幕永久在线不卡| 精品一区二区免费在线观看| 欧美亚洲愉拍一区二区| 国产精品天干天干在线综合| 狠狠色综合色综合网络| 欧美一区永久视频免费观看| 一区二区欧美在线观看| 成人av资源在线| 国产日韩高清在线| 国产一区二区不卡| 精品久久久久久久久久久久久久久 | 亚洲精品国产视频| www.欧美色图| 国产欧美精品在线观看| 欧美国产一区视频在线观看| 欧美自拍偷拍一区| 亚洲日本韩国一区| 成人精品一区二区三区四区| 日韩欧美中文一区| 日韩福利电影在线| 69堂成人精品免费视频| 亚洲大尺度视频在线观看| 在线视频一区二区三区| 亚洲另类春色校园小说| 99久久伊人久久99| 中文字幕日韩一区| 91丨porny丨在线| 国产精品短视频| 91啪九色porn原创视频在线观看| 中文字幕一区二区三区在线播放 | 欧美制服丝袜第一页| 中文字幕电影一区| 久久国产精品第一页| 欧美肥妇毛茸茸| 日韩高清一区在线| 欧美日韩电影一区| 日欧美一区二区| 欧美一区二区三区在线看| 欧美aaaaaa午夜精品| 日韩一区二区三区视频在线| 精品一区二区国语对白| 久久久精品免费观看| 大桥未久av一区二区三区中文| 亚洲国产高清不卡| 91免费版pro下载短视频| 亚洲一区二区三区视频在线播放| 69堂精品视频| 国产综合色产在线精品| 日韩毛片一二三区| 欧美日韩电影在线| 在线观看视频一区二区| 国产丝袜美腿一区二区三区| 国产主播一区二区三区| 国产精品美女www爽爽爽| 色域天天综合网| 蜜臀av一级做a爰片久久| 中文字幕精品一区| 欧美亚洲日本国产| 国产麻豆视频一区| 亚洲午夜日本在线观看| 久久蜜臀中文字幕| 色哟哟精品一区| 狠狠色丁香婷综合久久| 一区二区三区在线高清| 精品99999| 欧洲一区在线电影| 国产精品综合久久| 亚洲成人黄色影院| 欧美国产视频在线| 777色狠狠一区二区三区| 成人免费视频一区| 蜜臀久久久99精品久久久久久| 成人高清伦理免费影院在线观看| 国产精品电影一区二区| 日韩一区二区视频| 欧美综合一区二区| 国产精品一区二区果冻传媒| 亚洲精品国产高清久久伦理二区| 亚洲精品一区二区精华| 欧美日韩亚洲综合一区二区三区| 国产激情一区二区三区桃花岛亚洲| 亚洲v中文字幕| 国产精品理论片在线观看| 精品久久久久香蕉网| 欧美亚洲国产一卡| av毛片久久久久**hd| 极品尤物av久久免费看| 日韩av中文在线观看| 亚洲一区二区三区四区在线观看| 国产欧美日韩亚州综合| 久久综合久久综合久久综合| 欧美一区二区三区的| 欧美日韩免费一区二区三区| 9人人澡人人爽人人精品| 国产成人午夜精品5599| 国精产品一区一区三区mba视频| 亚洲444eee在线观看| 亚洲一区二区视频在线观看| 综合久久久久综合| 国产精品欧美一级免费| 欧美国产精品v| 国产日韩欧美一区二区三区综合| 精品久久久久香蕉网| 日韩精品一区二区在线| 欧美一区二区三区成人| 日韩三级精品电影久久久| 91精品啪在线观看国产60岁| 日本高清无吗v一区| 色婷婷综合久久久久中文一区二区 | 色综合久久综合网欧美综合网| 丁香婷婷综合色啪| 成人av免费在线| www.日韩精品| 97久久精品人人澡人人爽| 91蜜桃免费观看视频| 色8久久精品久久久久久蜜 | 国产精品18久久久久久久久| 国产一区二区电影| 成人av综合一区| 欧美在线观看18| 色老头久久综合| 欧美亚洲一区三区| 在线播放中文一区| 精品国产免费一区二区三区四区| 久久久久久久久久久久久久久99| 国产午夜精品久久久久久免费视| 国产日韩精品一区二区三区| 亚洲欧洲国产专区| 亚洲小说春色综合另类电影| 性做久久久久久免费观看| 麻豆久久久久久久| 国产高清无密码一区二区三区| 成人99免费视频| 欧美日韩成人高清| 欧美大白屁股肥臀xxxxxx| 欧美国产激情一区二区三区蜜月 | 国产欧美日韩久久| 一区二区三区欧美| 美女视频免费一区| 99久久er热在这里只有精品15| 在线亚洲一区观看| 欧美大胆人体bbbb| 亚洲男同性视频| 日本va欧美va欧美va精品| 国产91在线|亚洲| 欧美三电影在线| 久久精品欧美一区二区三区麻豆| 亚洲欧美在线aaa| 日韩不卡手机在线v区| 成人免费的视频| 欧美一区二区在线不卡| 国产精品国产三级国产有无不卡| 亚洲成人免费av| www.66久久| 欧美sm极限捆绑bd| 亚洲午夜电影网| 国产成人免费av在线| 欧美一级专区免费大片| 日韩美女精品在线| 国模少妇一区二区三区| 欧亚洲嫩模精品一区三区| 国产喂奶挤奶一区二区三区| 日韩精品福利网| 色欧美片视频在线观看| 久久久精品中文字幕麻豆发布| 午夜精品一区在线观看| 91亚洲永久精品| 久久无码av三级| 免费高清视频精品| 欧美日韩国产首页| 日韩美女视频一区二区 | av激情综合网| 色94色欧美sute亚洲线路二| 亚洲国产一区二区三区| 国产精品一区不卡| 91麻豆精品91久久久久同性| 亚洲天堂福利av| 国产老妇另类xxxxx| 日韩欧美aaaaaa| 偷窥国产亚洲免费视频| 在线观看www91| 亚洲免费电影在线| 成人av在线一区二区| 国产日产欧产精品推荐色| 六月丁香综合在线视频| 欧美电影在线免费观看| 一区二区三区免费网站| 99久久精品免费精品国产| 中文字幕国产一区二区| 成人h精品动漫一区二区三区| 国产日产欧美一区二区视频| 国产精品资源网站| 久久久久久久国产精品影院|