mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 18:20:26 +01:00
AbstractObserver::accepts() - add optional name parameter
This commit is contained in:
parent
7cae9a1b6d
commit
d66acced93
@ -38,7 +38,7 @@ public:
|
||||
|
||||
virtual void notify(Notification* pNf) const = 0;
|
||||
virtual bool equals(const AbstractObserver& observer) const = 0;
|
||||
virtual bool accepts(Notification* pNf) const = 0;
|
||||
virtual bool accepts(Notification* pNf, const char* pName = 0) const = 0;
|
||||
virtual AbstractObserver* clone() const = 0;
|
||||
virtual void disable() = 0;
|
||||
};
|
||||
|
@ -94,9 +94,9 @@ public:
|
||||
return pObs && pObs->_pObject == _pObject && pObs->_method == _method;
|
||||
}
|
||||
|
||||
bool accepts(Notification* pNf) const
|
||||
bool accepts(Notification* pNf, const char* pName = 0) const
|
||||
{
|
||||
return dynamic_cast<N*>(pNf) != 0;
|
||||
return dynamic_cast<N*>(pNf) && (!pName || pNf->name() == pName);
|
||||
}
|
||||
|
||||
AbstractObserver* clone() const
|
||||
|
@ -92,9 +92,9 @@ public:
|
||||
return pObs && pObs->_pObject == _pObject && pObs->_method == _method;
|
||||
}
|
||||
|
||||
bool accepts(Notification* pNf) const
|
||||
bool accepts(Notification* pNf, const char* pName = 0) const
|
||||
{
|
||||
return dynamic_cast<N*>(pNf) != 0;
|
||||
return dynamic_cast<N*>(pNf) && (!pName || pNf->name() == pName);
|
||||
}
|
||||
|
||||
AbstractObserver* clone() const
|
||||
|
Loading…
Reference in New Issue
Block a user