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

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

?? logger.c

?? 機器足球2D比賽程序 對trlen_base_2002的改進
?? 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#ifdef Solaris #include <varargs.h> // needed for va_list and va_start under Solaris#else #include <stdarg.h>#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一区二区三区免费野_久草精品视频
久久综合狠狠综合久久激情| 亚洲综合免费观看高清在线观看| 欧美日韩极品在线观看一区| 免费欧美高清视频| 亚洲制服丝袜av| 1024亚洲合集| 久久欧美一区二区| 91精品国产一区二区| 欧美日韩电影在线播放| 一本大道久久a久久精二百| 不卡一区二区三区四区| 国产成人欧美日韩在线电影| 国产精品99久久久久久宅男| 麻豆精品精品国产自在97香蕉| 亚洲成人一区在线| 亚洲激情自拍视频| 性感美女极品91精品| 亚洲国产精品久久久久婷婷884| 亚洲精品中文字幕在线观看| 亚洲欧美日韩国产综合| 亚洲黄色小视频| 国产精品亚洲视频| 国产伦精品一区二区三区免费| 日韩专区欧美专区| 国产在线播放一区二区三区| 久久99精品网久久| 久久激五月天综合精品| 免费人成在线不卡| 国产麻豆精品一区二区| 国产一区二区福利视频| 国产成人自拍网| 国产精品影视天天线| 91片黄在线观看| 欧美午夜电影网| 91精品国产综合久久精品图片| 日韩精品一区二区三区swag | 国产成人免费高清| 国产剧情一区二区三区| 韩日av一区二区| 99在线精品一区二区三区| 99久久国产综合精品麻豆| 91久久精品网| 欧美一区二区三区白人| 国产日韩欧美精品电影三级在线| 国产精品久久毛片av大全日韩| 国产精品电影一区二区| 亚洲一线二线三线视频| 久久99这里只有精品| 东方aⅴ免费观看久久av| 日本韩国欧美国产| 日韩一区二区三| 欧美www视频| 欧美国产精品劲爆| 国产精品久久777777| 亚洲一卡二卡三卡四卡五卡| 久久精品国产精品亚洲综合| 成人在线视频首页| 欧美日精品一区视频| 日韩美女在线视频| 一区二区三区成人在线视频| 日本不卡的三区四区五区| 国产精品一区二区三区99| av不卡免费在线观看| 欧美大片顶级少妇| 一区视频在线播放| 另类人妖一区二区av| 不卡的av电影| 久久久久久久综合日本| 一区二区三区美女视频| 国产在线精品一区二区三区不卡| 成人精品视频网站| 日韩欧美不卡在线观看视频| 亚洲视频精选在线| 美女在线视频一区| 972aa.com艺术欧美| 精品国产制服丝袜高跟| 一区二区三区av电影| 国产伦精品一区二区三区免费迷| 成人免费高清在线观看| 欧美一二三区在线观看| 亚洲桃色在线一区| 黄色日韩网站视频| 欧美在线免费播放| 亚洲欧美一区二区三区极速播放 | 一区二区在线观看免费视频播放 | 中文字幕欧美一区| 亚洲综合视频网| 欧美日韩中文另类| 欧美日韩激情一区二区三区| 久久影院视频免费| 欧美亚洲自拍偷拍| 91福利社在线观看| 久久网这里都是精品| 亚洲精选一二三| 国产真实乱对白精彩久久| 蜜桃在线一区二区三区| 欧美三级乱人伦电影| 亚洲视频免费观看| 国产91精品一区二区麻豆网站| 色综合天天狠狠| 欧美激情一区二区三区四区| 精品一区二区三区免费毛片爱| 欧美日韩中字一区| 国产三级一区二区| 国产不卡免费视频| 国产亚洲综合av| 国内成人精品2018免费看| 久久影院午夜片一区| 蜜桃av一区二区三区电影| 欧美日本一区二区在线观看| 国产精品无圣光一区二区| 国产不卡在线播放| 久久美女高清视频| 国内精品在线播放| 日韩免费福利电影在线观看| 男男gaygay亚洲| 欧美高清激情brazzers| 亚洲一区二区高清| 欧美丝袜自拍制服另类| 亚洲国产aⅴ天堂久久| 7777精品伊人久久久大香线蕉| 强制捆绑调教一区二区| 精品国产乱码久久久久久蜜臀| 国产精品亚洲第一区在线暖暖韩国| 久久久久久一二三区| 成人福利视频在线| 一区二区三区视频在线观看 | 久久综合九色欧美综合狠狠| 国产精品亚洲专一区二区三区| 国产目拍亚洲精品99久久精品| 99久久99久久精品国产片果冻| 亚洲一区二区三区自拍| 日韩视频123| 国产iv一区二区三区| 亚洲精品一二三四区| 欧美一区二区播放| 国产成人夜色高潮福利影视| 亚洲精品中文字幕乱码三区| 91精品在线免费观看| 国产一区免费电影| 亚洲精品高清在线| 日韩天堂在线观看| 不卡免费追剧大全电视剧网站| 亚洲最新视频在线观看| 日韩欧美美女一区二区三区| 成人一区二区三区视频| 亚洲国产sm捆绑调教视频| 日韩欧美在线网站| 99综合电影在线视频| 亚洲高清免费观看 | 日本一区二区三区在线观看| 91官网在线免费观看| 捆绑调教一区二区三区| 综合在线观看色| 日韩视频一区二区| 一本久久精品一区二区| 久久99精品久久久久久国产越南| 亚洲色图制服丝袜| 欧美不卡激情三级在线观看| 欧美中文字幕一区二区三区亚洲 | 欧美日韩亚洲综合一区二区三区| 精品午夜久久福利影院| 亚洲人快播电影网| 久久日一线二线三线suv| 日本久久一区二区三区| 国产乱子伦视频一区二区三区| 一区二区在线电影| www久久久久| 在线播放亚洲一区| 96av麻豆蜜桃一区二区| 精品在线观看免费| 亚洲国产cao| 亚洲视频综合在线| 久久久久亚洲蜜桃| 欧美一区二区福利视频| 欧美日韩中文另类| 色综合天天综合网天天狠天天| 国产一区二区三区黄视频| 免费观看久久久4p| 亚洲国产成人高清精品| 亚洲欧美色图小说| 中文字幕成人在线观看| 精品国产凹凸成av人网站| 51午夜精品国产| 欧美性大战久久久久久久| 99热在这里有精品免费| 国产精品99久久久久久久女警| 久久电影网站中文字幕| 日日夜夜免费精品| 午夜一区二区三区视频| 亚洲欧美激情一区二区| 最新国产の精品合集bt伙计| 国产女人18水真多18精品一级做| 精品国产乱码久久久久久久久| 日韩欧美精品在线视频| 777奇米四色成人影色区| 欧美人妇做爰xxxⅹ性高电影| 色素色在线综合| 色综合久久88色综合天天6| av一区二区三区|