haiku/headers/private/storage/AddOnMonitor.h
Stephan Aßmus 445751e17a Refactored AddOnMonitor to allow an alternative constructor which does not
yet take the AddOnMonitorHandler (and also does not Run() the looper
automatically). Added SetHandler() method which allows to set the handler
afterward. Does not require updates in existing clients.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39740 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-05 14:59:27 +00:00

52 lines
909 B
C++

/*
* Copyright 2004-2010, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _ADD_ON_MONITOR_H
#define _ADD_ON_MONITOR_H
#include <list>
#include <stdio.h>
#include <string>
#include <Looper.h>
#include <MessageRunner.h>
namespace BPrivate {
namespace Storage {
class AddOnMonitorHandler;
class AddOnMonitor : public BLooper {
private:
typedef BLooper inherited;
public:
AddOnMonitor();
// Does not automatically run the looper.
AddOnMonitor(AddOnMonitorHandler* handler);
// Automatically runs the looper.
virtual ~AddOnMonitor();
virtual status_t InitCheck();
void SetHandler(AddOnMonitorHandler* handler);
private:
status_t fInitCheck;
BMessageRunner* fPulseRunner;
};
}; // namespace Storage
}; // namespace BPrivate
using namespace BPrivate::Storage;
#endif // _ADD_ON_MONITOR_H