* ./hurricane/src/hurricane :
- Bug : Timer.h/.cpp, friend overload of the operator<<(ostream&) introduce a ostream<<() function in the Hurricane namespace which prevent the overload to resolve correctly under MacOS X (gcc 4.0).
This commit is contained in:
parent
9edbed80ae
commit
5afca323b2
|
@ -143,11 +143,11 @@ namespace Hurricane {
|
|||
}
|
||||
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const Timer& tm)
|
||||
string Timer::_getString () const
|
||||
{
|
||||
//CPUNormalizer cpunorm;
|
||||
double userSec = tm.getUserTime ();
|
||||
double normSec = tm.getUserTime (); // * cpunorm.getNormalizingFactor();
|
||||
double userSec = getUserTime ();
|
||||
double normSec = getUserTime (); // * cpunorm.getNormalizingFactor();
|
||||
char buffer[20];
|
||||
|
||||
if ( userSec > 0.01 ) {
|
||||
|
@ -160,15 +160,16 @@ namespace Hurricane {
|
|||
normSec -= delta;
|
||||
}
|
||||
|
||||
sprintf ( buffer, "%.1e", tm.getSysTime() );
|
||||
sprintf ( buffer, "%.1e", getSysTime() );
|
||||
|
||||
os << " " << userSec << " user,"
|
||||
<< " " << buffer << " system,"
|
||||
<< " " << tm.getRealTime() << " real,"
|
||||
<< " " << normSec << " norm'd "
|
||||
ostringstream os;
|
||||
os << " " << userSec << " user,"
|
||||
<< " " << buffer << " system,"
|
||||
<< " " << getRealTime() << " real,"
|
||||
<< " " << normSec << " norm'd "
|
||||
<< "sec ";
|
||||
|
||||
return os;
|
||||
return os.str();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -100,8 +100,7 @@ namespace Hurricane {
|
|||
inline size_t getMemorySize () const;
|
||||
inline size_t getIncrease () const;
|
||||
inline void resetIncrease ();
|
||||
// Friends Functions.
|
||||
friend std::ostream& operator<< ( std::ostream& os, const Timer& tm );
|
||||
string _getString () const;
|
||||
|
||||
protected:
|
||||
// Internal: Enum.
|
||||
|
@ -183,4 +182,7 @@ namespace Hurricane {
|
|||
} // End of Hurricane namespace.
|
||||
|
||||
|
||||
IOSTREAM_VALUE_SUPPORT(Hurricane::Timer);
|
||||
|
||||
|
||||
#endif // __HURRICANE_TIMER__
|
||||
|
|
Loading…
Reference in New Issue