fixed some Debug.h-related bugs which prevented to code from compiling

in non-debug mode
This commit is contained in:
fgerlits 2006-12-01 14:54:14 +00:00
parent e130b16409
commit a38ebdeadd
2 changed files with 27 additions and 6 deletions

View File

@ -35,6 +35,8 @@
#include <iostream> #include <iostream>
#include <sys/time.h> #include <sys/time.h>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <XmlRpcValue.h>
#ifndef DEBUG_PREFIX #ifndef DEBUG_PREFIX
#define CMP_PREFIX "" #define CMP_PREFIX ""
@ -100,7 +102,6 @@ using namespace LiveSupport::Core;
* @return this stream * @return this stream
*/ */
NoDebugStream &operator<<(unsigned int ) { return *this; } NoDebugStream &operator<<(unsigned int ) { return *this; }
/** /**
* Does nothing. * Does nothing.
* @return this stream * @return this stream
@ -131,9 +132,29 @@ using namespace LiveSupport::Core;
* @return this stream * @return this stream
*/ */
NoDebugStream& operator<<(unsigned long) { return *this; } NoDebugStream& operator<<(unsigned long) { return *this; }
/**
* Does nothing.
* @return this stream
*/
NoDebugStream& operator<<(std::string) { return *this; } NoDebugStream& operator<<(std::string) { return *this; }
/**
* Does nothing.
* @return this stream
*/
NoDebugStream& operator<<(boost::posix_time::ptime)
{ return *this; }
/**
* Does nothing.
* @return this stream
*/
NoDebugStream& operator<<(boost::posix_time::time_duration)
{ return *this; }
/**
* Does nothing.
* @return this stream
*/
NoDebugStream& operator<<(XmlRpc::XmlRpcValue)
{ return *this; }
}; };
static inline NoDebugStream debug() { return NoDebugStream(); } static inline NoDebugStream debug() { return NoDebugStream(); }
static inline NoDebugStream warning() { return NoDebugStream(); } static inline NoDebugStream warning() { return NoDebugStream(); }

View File

@ -99,7 +99,7 @@ SchedulerThread :: nextStep(Ptr<ptime>::Ref now) throw ()
{ {
if (nextEvent) { if (nextEvent) {
if (imminent(now, nextInitTime)) { if (imminent(now, nextInitTime)) {
debug() << "event init coming" << std::endl; debug() << "event init coming" << endl;
try { try {
nextEvent->initialize(); nextEvent->initialize();
} catch (std::exception &e) { } catch (std::exception &e) {
@ -111,7 +111,7 @@ SchedulerThread :: nextStep(Ptr<ptime>::Ref now) throw ()
<< std::endl; << std::endl;
} }
} else if (imminent(now, nextEventTime)) { } else if (imminent(now, nextEventTime)) {
debug() << "event start coming" << std::endl; debug() << "event start coming" << endl;
Ptr<time_duration>::Ref timeLeft(new time_duration(*nextEventTime Ptr<time_duration>::Ref timeLeft(new time_duration(*nextEventTime
- *now)); - *now));
TimeConversion::sleep(timeLeft); TimeConversion::sleep(timeLeft);
@ -123,7 +123,7 @@ SchedulerThread :: nextStep(Ptr<ptime>::Ref now) throw ()
} }
if (currentEvent && imminent(now, currentEventEnd)) { if (currentEvent && imminent(now, currentEventEnd)) {
debug() << "event end coming" << std::endl; debug() << "event end coming" << endl;
Ptr<time_duration>::Ref timeLeft(new time_duration(*currentEventEnd Ptr<time_duration>::Ref timeLeft(new time_duration(*currentEventEnd
- *now)); - *now));
TimeConversion::sleep(timeLeft); TimeConversion::sleep(timeLeft);