| 1 |
#ifndef _NAME_OBSERVER_H_ |
| 2 |
#define _NAME_OBSERVER_H_ |
| 3 |
|
| 4 |
#include <string> |
| 5 |
#include <memory> |
| 6 |
|
| 7 |
/** |
| 8 |
* greebo: A NameObserver is observing one name in a map Namespace. |
| 9 |
* |
| 10 |
* It provides "event methods" which get called by the Namespace on |
| 11 |
* any name changes. |
| 12 |
*/ |
| 13 |
class NameObserver |
| 14 |
{ |
| 15 |
public: |
| 16 |
virtual ~NameObserver() {} |
| 17 |
/** |
| 18 |
* greebo: This is the "change" event, which gets issued by the Namespace. |
| 19 |
* The old name as well as the new name is passed along. |
| 20 |
*/ |
| 21 |
virtual void onNameChange(const std::string& oldName, const std::string& newName) = 0; |
| 22 |
}; |
| 23 |
typedef std::shared_ptr<NameObserver> NameObserverPtr; |
| 24 |
|
| 25 |
#endif /* _NAME_OBSERVER_H_ */ |