configStatistics.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "configStatistics.h"
00019
00020 #include "config.h"
00021 #include "global.h"
00022
00023 #ifdef WIN32_VC
00024 # define snprintf _snprintf
00025 #endif
00026
00027 namespace eq
00028 {
00029
00030 ConfigStatistics::ConfigStatistics( const Statistic::Type type,
00031 Config* config )
00032 : StatisticSampler< Config >( type, config, config->getCurrentFrame( ))
00033 , ignore( false )
00034 {
00035 const std::string& name = config->getName();
00036 if( name.empty( ))
00037 snprintf( event.data.statistic.resourceName, 32, "config" );
00038 else
00039 snprintf( event.data.statistic.resourceName, 32, "%s", name.c_str( ));
00040
00041 event.data.statistic.startTime = config->getTime();
00042 }
00043
00044
00045 ConfigStatistics::~ConfigStatistics()
00046 {
00047 if( ignore )
00048 return;
00049
00050 event.data.statistic.endTime = _owner->getTime();
00051 _owner->sendEvent( event );
00052 }
00053
00054 }