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

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

?? logger.c

?? uva trilearn的robocup源程序
?? C
字號:
/*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 Logger.C<pre><b>File:</b>          Logger.C<b>Project:</b>       Robocup Soccer Simulation Team: UvA Trilearn<b>Authors:</b>       Jelle Kok<b>Created:</b>       3/3/2000<b>Last Revision:</b> $ID$<b>Contents:</b>      This file contains the definitions for the class to log               information about the system to any output stream. A               range can be specified for which the received log               information is printed. Furthermore it is possible to               print the time since the timer of the Logger has been               restarted.<hr size=2><h2><b>Changes</b></h2><b>Date</b>             <b>Author</b>          <b>Comment</b>3/3/2001         Jelle Kok       Initial version created</pre>*/#include "Logger.h"#include <stdio.h>    // needed for vsprintf#include <string>     // needed for string#include <cstdarg>using namespace std;#ifdef Solaris #include <varargs.h> // needed for va_list and va_start under Solaris#endifLogger Log;          /*!<Logger instantation that can be used by all classes *//*****************************************************************************//**************************** LOGGER *****************************************//*****************************************************************************//*!This is the constructor for the Logger. The output stream, the minimal and   maximal log level can all be specified. The timer in this class is also   restarted.   \param o outputstream (file or cout) to which information is printed            (default cout)   \param iMin minimal log level (default 0)   \param iMax maximal log level (default 0) */Logger::Logger( ostream& o, int iMin, int iMax ){  strcpy( m_strHeader, "" );  m_timing.restartTime();  m_os = &o;}/*!This method can be used to log information. Only when the specified   level of the message is part of the set of logged levels the   information is logged. This method receives a a normal string that    is logged.   \param iLevel level corresponding to this message   \param str string that is logged when iLevel is a logging lvel.   \return bool indicating whether the message was logged or not. */bool Logger::log( int iLevel, string str){  if( isInLogLevel( iLevel ) )  {    *m_os << m_strHeader << str;    return true;  }  return false;}/*!This method can be used to log information. Only when the specified   level of the message is part of the set of logged values the   information is logged. This method receives a character string that may   contain format specifiers that are also available to 'printf' (like %d, %f,   etc.). The remaining arguments are the variables that have to be filled in   at the location of the specifiers.   \param iLevel level corresponding to this message   \param str character string with (possible) format specifiers   \param ... variables that define the values of the specifiers.   \return bool indicating whether the message was logged or not. */bool Logger::log( int iLevel, char *str, ... ){  if( isInLogLevel( iLevel ) )  {    va_list ap;#ifdef Solaris    va_start( ap );#else    va_start( ap, str );#endif    vsprintf( m_buf, str, ap );    va_end(ap);    *m_os << m_strHeader << m_buf << endl;    return true;  }  return false;}/*!This method can be used to log information. Only when the specified   level of the message is an element in the set of logged levels the   information is logged. This method receives a character string that may   contain format specifiers that are also available to 'printf' (like %d, %f,   etc.). The remaining arguments are the variables that have to be filled in   at the location of the specifiers. Before the logged message the elapsed   time since the timer has been restarted is printed.   \param iLevel level corresponding to this message   \param str character string with (possible) format specifiers   \param ... variables that define the values of the specifiers.   \return bool indicating whether the message was logged or not. */bool Logger::logWithTime( int iLevel, char *str, ... ){  if( isInLogLevel( iLevel ) )  {    va_list ap;#ifdef Solaris    va_start( ap );#else    va_start( ap, str );#endif    vsprintf( m_buf, str, ap );    va_end(ap);    string s = m_strHeader;    s.append( m_buf );    s.copy( m_buf, string::npos );    m_buf[s.length()] = '\0';    m_timing.printTimeDiffWithText( *m_os, m_buf );    return true;  }  return false;}/*!This method restarts the timer associated with this Logger. */void Logger::restartTimer(){  return m_timing.restartTime();}/*! Return the instance of the timing class that denotes the time the counter    is running. */Timing Logger::getTiming( ){  return m_timing;}/*!This method returns whether the supplied log level is recorded, thus whether   it is part of the set of logged levels.   \param iLevel log level that should be checked   \return bool indicating whether the supplied log level is logged. */bool Logger::isInLogLevel( int iLevel ){  return m_setLogLevels.find( iLevel ) != m_setLogLevels.end() ;}/*! This method inserts the log level 'iLevel' to the set of logged levels.     Information from this log level will be printed.     \param iLevel level that will be added to the set    \return bool indicating whether the update was successfull. */bool  Logger::addLogLevel( int iLevel ){  m_setLogLevels.insert( iLevel );   return true;}/*! This method inserts all the log levels in the interval [iMin..iMax] to    the set of logged levels.     \param iMin minimum log level that is added    \param iMax maximum log level that is added     \return bool indicating whether the update was successfull. */bool  Logger::addLogRange( int iMin, int iMax ){  bool bReturn = true;  for( int i = iMin ; i <= iMax;  i++ )    bReturn &= addLogLevel( i );  return bReturn;}/*! This method returns the current header that is written before the actual    text that has to be logged.    \return current header */char* Logger::getHeader( ){  return m_strHeader;}/*! This method sets the header that is written before the actual logging text.    \param str that represents the character string    \return bool indicating whether the update was succesfull */bool Logger::setHeader( char *str ){  strcpy( m_strHeader, str );  return true;}/*! This method sets a predefined header that is written before the actual    logging text. The header is represented by two integers which are    written between parentheses, i.e. (9, 2401).    \param i1 first integer    \param i2 second integer    \return bool indicating whether the update was succesfull */bool Logger::setHeader( int i1, int i2 ){  sprintf( m_strHeader, "(%d, %d) ", i1, i2 );  return true;}/*!This method sets the output stream to which the log information is written.   This outputstream can be standard output (cout) or a reference to a   file.   \param o outputstream to which log information is printed.   \return bool indicating whether update was succesfull. */bool Logger::setOutputStream( ostream& o ){  m_os = &o;  return true;}/*!This method returns the output stream to which the log information is    written. This outputstream can be standard output (cout) or a reference to a   file.   \return o outputstream to which log information is printed. */ostream& Logger::getOutputStream(  ){  return *m_os;}/*! This method outputs all the log levels that are logged to the output stream    os.     \param os output stream to which log levels are printed. */void Logger::showLogLevels( ostream &os ){  set<int>::iterator itr;  for (itr = m_setLogLevels.begin() ; itr != m_setLogLevels.end() ; itr++)    os << *itr << " " ;  os << endl;  }/******************************************************************************//*********************** CLASS TIMING *****************************************//******************************************************************************//*! This method returns the difference between two timevals in seconds.    \param tv1 first timeval    \param tv2 second timeval    \return double representing the difference between t1 and t2 in seconds */double Timing::getTimeDifference( struct timeval tv1, struct timeval tv2 ){  return  ((double)tv1.tv_sec + (double)tv1.tv_usec/1000000 ) -          ((double)tv2.tv_sec + (double)tv2.tv_usec/1000000 ) ;}/*! This method prints the time in seconds that elapsed since    the timer was restarted. It is possible to multiply this time with a    factor, such that it can be used for different quantity values. In the    default case this value is 1000 with the effect that the resulting value    resembles miliseconds.     \param os output stream to which output should be written.    \param str that should be printed    \param iFactor with which the elapsed time is multiplied (default 1000) */void Timing::printTimeDiffWithText( ostream &os, char *str, int iFactor ){  // set the with to 6 and fill remaining places with '0'.  os <<setw(6)<< setfill('0')<< getElapsedTime()*iFactor << ":" << str << endl;}/*! This method returns the time (in seconds) since the last time the timer    was restarted.    \return double seconds that have passed since last restart of timer */double Timing::getElapsedTime( ){  struct timeval time2;  gettimeofday( &time2, NULL );  return getTimeDifference( time2, time1 );}/*! This method restarts the timer by setting it to the current time */void Timing::restartTime( ){  gettimeofday( &time1, NULL );}/*****************************************************************************//**************************** TESTING PURPOSES *******************************//*****************************************************************************//*#include<sys/poll.h>int main( void ){  ofstream fout( "temp.txt" );  Logger log( fout, 0, 2 );  log.log( 0, "hello" );  log.setHeader( "jelle" );  poll(0,0,1000);  log.log( 2, "hello" );  log.log( 3, "hello" );  int j = 2;  double i = 2.324234;  printf( "hoi: "); fflush(stdout);  log.logWithTime( 1, "|%f %d|", i, j);}*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品成人综合| 国产日韩欧美精品一区| 一区二区三区高清不卡| 成人三级伦理片| 久久精品在线免费观看| 久久99久久久欧美国产| 日韩一区二区在线观看视频播放| 亚洲一区二区欧美日韩| 色欧美片视频在线观看| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 国产suv精品一区二区三区| 美女脱光内衣内裤视频久久影院| 欧美系列亚洲系列| 亚洲激情图片小说视频| 一本色道久久综合亚洲aⅴ蜜桃| 日韩美女精品在线| 色综合av在线| 一区二区三区在线视频免费观看 | 亚洲视频一二三区| www.日韩大片| 综合在线观看色| 99re这里只有精品首页| 亚洲蜜桃精久久久久久久| 色综合久久综合网欧美综合网| 亚洲码国产岛国毛片在线| 日本乱人伦aⅴ精品| 亚洲一区二区高清| 欧美日本一区二区三区四区 | 国产精品久久久一本精品 | 一本色道综合亚洲| 亚洲综合色区另类av| 欧美日韩亚洲高清一区二区| 丝袜诱惑制服诱惑色一区在线观看| 欧美日韩一区二区三区高清 | 毛片av一区二区三区| 精品国产一二三| 风流少妇一区二区| 综合色天天鬼久久鬼色| 欧美综合在线视频| 日本va欧美va精品| 久久精品亚洲精品国产欧美| av色综合久久天堂av综合| 一级日本不卡的影视| 欧美高清视频www夜色资源网| 另类小说欧美激情| 国产喷白浆一区二区三区| 91日韩精品一区| 午夜精品福利一区二区蜜股av| 蜜桃视频一区二区| 久久精品这里都是精品| 色婷婷久久99综合精品jk白丝| 同产精品九九九| 久久久久久久久久久黄色| 91性感美女视频| 日韩av在线免费观看不卡| 久久亚洲精精品中文字幕早川悠里 | 韩国视频一区二区| 中文字幕永久在线不卡| 欧美二区在线观看| 91网站最新地址| 99久久精品免费看| 蓝色福利精品导航| 国产精品区一区二区三区| 欧美主播一区二区三区美女| 久久www免费人成看片高清| 国产精品丝袜一区| 欧美日本国产视频| 大陆成人av片| 五月天一区二区| 日本一区二区三区四区在线视频 | 欧美日韩在线播放三区四区| 精品一二三四在线| 亚洲精品中文字幕在线观看| 日韩免费看的电影| 91亚洲精品一区二区乱码| 美脚の诱脚舐め脚责91| 中文字幕在线观看一区| 91精品国产综合久久精品app | 99综合电影在线视频| 日韩极品在线观看| 成人免费一区二区三区在线观看| 91麻豆精品国产综合久久久久久| 国产亚洲综合色| 欧美视频一区二区三区在线观看| 国产精品123| 亚洲不卡在线观看| 国产精品对白交换视频| 亚洲免费观看视频| 亚洲一级二级三级| 99re成人精品视频| 精品一区二区三区不卡 | 国产人伦精品一区二区| 欧美精品免费视频| 99re免费视频精品全部| 国产精品一品视频| 日本亚洲免费观看| 一卡二卡三卡日韩欧美| 国产精品丝袜黑色高跟| 精品精品国产高清一毛片一天堂| 欧美视频第二页| 99久久99久久免费精品蜜臀| 国内精品伊人久久久久av一坑 | 久久av中文字幕片| 亚洲va韩国va欧美va| 日韩久久一区二区| 亚洲国产高清在线观看视频| 精品久久久久久久久久久久包黑料 | 美女一区二区在线观看| 亚洲一区在线免费观看| 国产精品国产三级国产普通话99| 精品国产一区二区三区不卡 | 欧美天堂亚洲电影院在线播放| 波多野结衣中文字幕一区二区三区| 国内精品写真在线观看| 日韩av在线免费观看不卡| 亚洲中国最大av网站| 亚洲色图视频网站| 亚洲国产精品99久久久久久久久| 精品国产区一区| 欧美一区二区视频在线观看| 欧美调教femdomvk| 一本久久a久久免费精品不卡| 成人性视频网站| 国产精品1024| 国产一区亚洲一区| 久久综合综合久久综合| 日精品一区二区三区| 香蕉久久一区二区不卡无毒影院 | 蜜桃在线一区二区三区| 日韩激情在线观看| 肉丝袜脚交视频一区二区| 午夜在线电影亚洲一区| 亚洲国产成人va在线观看天堂| 一区二区三区蜜桃| 亚洲一区二区三区三| 亚洲自拍都市欧美小说| 亚洲福利电影网| 亚洲电影第三页| 天天色综合天天| 天堂久久一区二区三区| 日韩在线一区二区三区| 日韩精品国产欧美| 免费在线看一区| 捆绑调教美女网站视频一区| 激情图片小说一区| 国产精品99久久久久久似苏梦涵| 国产精品亚洲一区二区三区妖精| 国产成人自拍高清视频在线免费播放| 国产精品自在欧美一区| 国产福利精品一区二区| 成人av网在线| 色一情一乱一乱一91av| 欧美日韩国产欧美日美国产精品| 欧美高清hd18日本| 精品日韩一区二区三区| 欧美精品一区二区在线观看| 国产日韩欧美精品一区| 亚洲视频你懂的| 亚洲无线码一区二区三区| 日韩av电影一区| 国产主播一区二区| 成人黄色综合网站| 日本二三区不卡| 欧美伦理视频网站| 精品国产91洋老外米糕| 中文一区二区在线观看| 亚洲精品国产精华液| 日韩主播视频在线| 黑人巨大精品欧美一区| 成人午夜碰碰视频| 在线看不卡av| 日韩一区二区在线观看视频播放| 国产性做久久久久久| 亚洲私人影院在线观看| 日韩精品一二三| 国产福利一区二区三区| 91黄色小视频| 日韩三级视频中文字幕| 国产精品美女久久久久高潮 | 欧美激情在线观看视频免费| 亚洲精品国产a久久久久久 | 日本不卡不码高清免费观看| 国产剧情在线观看一区二区| 色综合天天做天天爱| 日韩一区二区三区视频在线观看| 国产夜色精品一区二区av| 一区二区三区视频在线看| 久久er精品视频| 97久久精品人人爽人人爽蜜臀| 制服丝袜激情欧洲亚洲| 久久久久九九视频| 一区2区3区在线看| 国产精品影视在线观看| 欧美无砖专区一中文字| 国产亚洲精品精华液| 亚洲成人免费观看| 丁香激情综合五月| 51精品视频一区二区三区| 国产精品免费av| 蜜臀久久久久久久|