Convert NOTIFY to OSG_NOTIFY to avoid problems with polution of users apps with the NOTIFY macro

This commit is contained in:
Robert Osfield
2010-02-10 12:44:59 +00:00
parent 6ab51c7c47
commit f17e401347
42 changed files with 884 additions and 884 deletions

View File

@@ -76,22 +76,22 @@ ref_ptr<Operation> OperationQueue::getNextOperation(bool blockIfEmpty)
if (!currentOperation->getKeep())
{
// NOTIFY(osg::INFO)<<"removing "<<currentOperation->getName()<<std::endl;
// OSG_NOTIFY(osg::INFO)<<"removing "<<currentOperation->getName()<<std::endl;
// remove it from the operations queue
_currentOperationIterator = _operations.erase(_currentOperationIterator);
// NOTIFY(osg::INFO)<<"size "<<_operations.size()<<std::endl;
// OSG_NOTIFY(osg::INFO)<<"size "<<_operations.size()<<std::endl;
if (_operations.empty())
{
// NOTIFY(osg::INFO)<<"setting block "<<_operations.size()<<std::endl;
// OSG_NOTIFY(osg::INFO)<<"setting block "<<_operations.size()<<std::endl;
_operationsBlock->set(false);
}
}
else
{
// NOTIFY(osg::INFO)<<"increment "<<_currentOperation->getName()<<std::endl;
// OSG_NOTIFY(osg::INFO)<<"increment "<<_currentOperation->getName()<<std::endl;
// move on to the next operation in the list.
++_currentOperationIterator;
@@ -102,7 +102,7 @@ ref_ptr<Operation> OperationQueue::getNextOperation(bool blockIfEmpty)
void OperationQueue::add(Operation* operation)
{
NOTIFY(osg::INFO)<<"Doing add"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Doing add"<<std::endl;
// acquire the lock on the operations queue to prevent anyone else for modifying it at the same time
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_operationsMutex);
@@ -115,7 +115,7 @@ void OperationQueue::add(Operation* operation)
void OperationQueue::remove(Operation* operation)
{
NOTIFY(osg::INFO)<<"Doing remove operation"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Doing remove operation"<<std::endl;
// acquire the lock on the operations queue to prevent anyone else for modifying it at the same time
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_operationsMutex);
@@ -138,7 +138,7 @@ void OperationQueue::remove(Operation* operation)
void OperationQueue::remove(const std::string& name)
{
NOTIFY(osg::INFO)<<"Doing remove named operation"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Doing remove named operation"<<std::endl;
// acquire the lock on the operations queue to prevent anyone else for modifying it at the same time
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_operationsMutex);
@@ -166,7 +166,7 @@ void OperationQueue::remove(const std::string& name)
void OperationQueue::removeAllOperations()
{
NOTIFY(osg::INFO)<<"Doing remove all operations"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Doing remove all operations"<<std::endl;
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_operationsMutex);
@@ -203,7 +203,7 @@ void OperationQueue::runOperations(Object* callingObject)
++_currentOperationIterator;
}
// NOTIFY(osg::INFO)<<"Doing op "<<_currentOperation->getName()<<" "<<this<<std::endl;
// OSG_NOTIFY(osg::INFO)<<"Doing op "<<_currentOperation->getName()<<" "<<this<<std::endl;
// call the graphics operation.
(*operation)(callingObject);
@@ -258,11 +258,11 @@ OperationThread::OperationThread():
OperationThread::~OperationThread()
{
//NOTIFY(osg::NOTICE)<<"Destructing graphics thread "<<this<<std::endl;
//OSG_NOTIFY(osg::NOTICE)<<"Destructing graphics thread "<<this<<std::endl;
cancel();
//NOTIFY(osg::NOTICE)<<"Done Destructing graphics thread "<<this<<std::endl;
//OSG_NOTIFY(osg::NOTICE)<<"Done Destructing graphics thread "<<this<<std::endl;
}
void OperationThread::setOperationQueue(OperationQueue* opq)
@@ -286,13 +286,13 @@ void OperationThread::setDone(bool done)
if (done)
{
NOTIFY(osg::INFO)<<"set done "<<this<<std::endl;
OSG_NOTIFY(osg::INFO)<<"set done "<<this<<std::endl;
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_threadMutex);
if (_currentOperation.valid())
{
NOTIFY(osg::INFO)<<"releasing "<<_currentOperation.get()<<std::endl;
OSG_NOTIFY(osg::INFO)<<"releasing "<<_currentOperation.get()<<std::endl;
_currentOperation->release();
}
}
@@ -303,7 +303,7 @@ void OperationThread::setDone(bool done)
int OperationThread::cancel()
{
NOTIFY(osg::INFO)<<"Cancelling OperationThread "<<this<<" isRunning()="<<isRunning()<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Cancelling OperationThread "<<this<<" isRunning()="<<isRunning()<<std::endl;
int result = 0;
if( isRunning() )
@@ -311,7 +311,7 @@ int OperationThread::cancel()
_done = true;
NOTIFY(osg::INFO)<<" Doing cancel "<<this<<std::endl;
OSG_NOTIFY(osg::INFO)<<" Doing cancel "<<this<<std::endl;
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_threadMutex);
@@ -343,13 +343,13 @@ int OperationThread::cancel()
}
#endif
// commenting out debug info as it was cashing crash on exit, presumable
// due to NOTIFY or std::cout destructing earlier than this destructor.
NOTIFY(osg::DEBUG_INFO)<<" Waiting for OperationThread to cancel "<<this<<std::endl;
// due to OSG_NOTIFY or std::cout destructing earlier than this destructor.
OSG_NOTIFY(osg::DEBUG_INFO)<<" Waiting for OperationThread to cancel "<<this<<std::endl;
OpenThreads::Thread::YieldCurrentThread();
}
}
NOTIFY(osg::INFO)<<" OperationThread::cancel() thread cancelled "<<this<<" isRunning()="<<isRunning()<<std::endl;
OSG_NOTIFY(osg::INFO)<<" OperationThread::cancel() thread cancelled "<<this<<" isRunning()="<<isRunning()<<std::endl;
return result;
}
@@ -381,13 +381,13 @@ void OperationThread::removeAllOperations()
void OperationThread::run()
{
NOTIFY(osg::INFO)<<"Doing run "<<this<<" isRunning()="<<isRunning()<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Doing run "<<this<<" isRunning()="<<isRunning()<<std::endl;
bool firstTime = true;
do
{
// NOTIFY(osg::NOTICE)<<"In thread loop "<<this<<std::endl;
// OSG_NOTIFY(osg::NOTICE)<<"In thread loop "<<this<<std::endl;
ref_ptr<Operation> operation;
ref_ptr<OperationQueue> operationQueue;
@@ -407,7 +407,7 @@ void OperationThread::run()
_currentOperation = operation;
}
// NOTIFY(osg::INFO)<<"Doing op "<<_currentOperation->getName()<<" "<<this<<std::endl;
// OSG_NOTIFY(osg::INFO)<<"Doing op "<<_currentOperation->getName()<<" "<<this<<std::endl;
// call the graphics operation.
(*operation)(_parent.get());
@@ -426,10 +426,10 @@ void OperationThread::run()
firstTime = false;
}
// NOTIFY(osg::NOTICE)<<"operations.size()="<<_operations.size()<<" done="<<_done<<" testCancel()"<<testCancel()<<std::endl;
// OSG_NOTIFY(osg::NOTICE)<<"operations.size()="<<_operations.size()<<" done="<<_done<<" testCancel()"<<testCancel()<<std::endl;
} while (!testCancel() && !_done);
NOTIFY(osg::INFO)<<"exit loop "<<this<<" isRunning()="<<isRunning()<<std::endl;
OSG_NOTIFY(osg::INFO)<<"exit loop "<<this<<" isRunning()="<<isRunning()<<std::endl;
}