14 #include "boost/bind.hpp" 27 QMutexLocker sentry(&mActionsMutex);
28 mPendingActions.push_back(action);
31 this->invokePendingAction();
34 void ThreadMethodInvoker::invokePendingAction()
36 QMetaObject::invokeMethod(
this,
"pendingAction", Qt::QueuedConnection);
39 void ThreadMethodInvoker::pendingAction()
41 while (this->executeAction());
44 bool ThreadMethodInvoker::executeAction()
56 QMutexLocker sentry(&mActionsMutex);
59 if (mPendingActions.isEmpty())
62 action = mPendingActions.front();
63 mPendingActions.pop_front();
102 mQueue->callInLogThread(action);
132 int LogThread::getDefaultTimeout(MESSAGE_LEVEL messageLevel)
const
virtual void installObserver(MessageObserverPtr observer, bool resend)
void uninstall(MessageObserverPtr observer)
ThreadMethodInvoker(QObject *parent)
virtual void uninstallObserver(MessageObserverPtr observer)
static MessageRepositoryPtr create()
virtual void setLoggingFolder(QString absoluteLoggingFolderPath)
call during startup, will fail if called when running
LogThread(QObject *parent=NULL)
MESSAGE_LEVEL mMessageLevel
MessageRepositoryPtr mRepository
virtual void executeSetLoggingFolder(QString absoluteLoggingFolderPath)=0
void emittedMessage(Message message)
emitted for each new message, in addition to writing to observer.
void install(MessageObserverPtr observer, bool resend)
boost::shared_ptr< class MessageObserver > MessageObserverPtr
boost::function< void()> ActionType
void callInLogThread(ThreadMethodInvoker::ActionType action)
void callInLogThread(ActionType action)
void processMessage(Message msg)
Message cleanupMessage(Message message)
Namespace for all CustusX production code.