mirror of
https://github.com/gelldur/EventBus.git
synced 2025-01-15 01:58:19 +08:00
Remove deprecated stuff
It was breaking encapsulation
This commit is contained in:
parent
1e7500607b
commit
66a7945084
@ -11,36 +11,6 @@
|
|||||||
namespace Dexode
|
namespace Dexode
|
||||||
{
|
{
|
||||||
|
|
||||||
class [[deprecated("This class will be removed, is breaking API")]] BusAttorney
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
BusAttorney(std::shared_ptr<EventBus> bus)
|
|
||||||
: _bus(std::move(bus))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notify all listeners for event
|
|
||||||
*
|
|
||||||
* @param event your event struct
|
|
||||||
*/
|
|
||||||
template<typename Event>
|
|
||||||
[[deprecated]]
|
|
||||||
void notify(const Event& event) const
|
|
||||||
{
|
|
||||||
_bus->notify(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
[[deprecated]]
|
|
||||||
std::shared_ptr<EventBus> extract() const
|
|
||||||
{
|
|
||||||
return _bus;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::shared_ptr<EventBus> _bus;
|
|
||||||
};
|
|
||||||
|
|
||||||
class EventCollector
|
class EventCollector
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -93,10 +63,6 @@ public:
|
|||||||
|
|
||||||
bool isUsing(const std::shared_ptr<EventBus>& bus) const;
|
bool isUsing(const std::shared_ptr<EventBus>& bus) const;
|
||||||
|
|
||||||
///I wan't explicitly say getBus. Ok we could add method for notify but this is more explicit
|
|
||||||
[[deprecated("This method will be removed, is breaking encapsulation")]]
|
|
||||||
BusAttorney getBus() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int _token = 0;
|
int _token = 0;
|
||||||
std::shared_ptr<EventBus> _bus;
|
std::shared_ptr<EventBus> _bus;
|
||||||
|
@ -87,11 +87,6 @@ void EventCollector::unlistenAll()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BusAttorney EventCollector::getBus() const
|
|
||||||
{
|
|
||||||
return BusAttorney{_bus};
|
|
||||||
}
|
|
||||||
|
|
||||||
bool EventCollector::isUsing(const std::shared_ptr<EventBus>& bus) const
|
bool EventCollector::isUsing(const std::shared_ptr<EventBus>& bus) const
|
||||||
{
|
{
|
||||||
return _bus == bus;
|
return _bus == bus;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user