Mock implementation of ISubject (Event Bus).
More...
|
| void | notify (const Event &event) const override |
| | Notifies all attached observers about an event.
|
| void | attach (std::shared_ptr< IObserver > observer) override |
| | Attaches an observer to the subject.
|
| void | detach (std::shared_ptr< IObserver > observer) override |
| | Detaches an observer from the subject.
|
| void | notify (const Event &event) const override |
| | Notifies all attached observers about an event.
|
| void | attach (std::shared_ptr< IObserver > observer) override |
| | Attaches an observer to the subject.
|
| void | detach (std::shared_ptr< IObserver > observer) override |
| | Detaches an observer from the subject.
|
| virtual | ~ISubject ()=default |
| | Virtual destructor.
|
|
|
std::vector< IObserver * > | observers |
| | Collection of registered observers.
|
Mock implementation of ISubject (Event Bus).
Mock implementation of ISubject.
- This mock silences all notifications, ensuring that Index logic is tested without side effects from the event system.
- This mock silences all event notifications, ensuring ObjectStorage tests run without side effects from the event system.
◆ attach() [1/2]
| void svcs::test::core::MockSubject::attach |
( |
std::shared_ptr< IObserver > | observer | ) |
|
|
inlineoverridevirtual |
Attaches an observer to the subject.
- Parameters
-
| observer | A smart pointer to the observer object to attach. |
Implements svcs::services::ISubject.
◆ attach() [2/2]
| void svcs::test::core::MockSubject::attach |
( |
std::shared_ptr< IObserver > | observer | ) |
|
|
inlineoverridevirtual |
Attaches an observer to the subject.
- Parameters
-
| observer | A smart pointer to the observer object to attach. |
Implements svcs::services::ISubject.
◆ detach() [1/2]
| void svcs::test::core::MockSubject::detach |
( |
std::shared_ptr< IObserver > | observer | ) |
|
|
inlineoverridevirtual |
Detaches an observer from the subject.
- Parameters
-
| observer | A smart pointer to the observer object to detach. |
Implements svcs::services::ISubject.
◆ detach() [2/2]
| void svcs::test::core::MockSubject::detach |
( |
std::shared_ptr< IObserver > | observer | ) |
|
|
inlineoverridevirtual |
Detaches an observer from the subject.
- Parameters
-
| observer | A smart pointer to the observer object to detach. |
Implements svcs::services::ISubject.
◆ notify() [1/2]
| void svcs::test::core::MockSubject::notify |
( |
const Event & | event | ) |
const |
|
inlineoverridevirtual |
Notifies all attached observers about an event.
This method is made public so that component classes (like ObjectStorage) can publish events through the injected ISubject pointer. The method is declared as const because event notification is a logically non-mutating action on the Subject's state.
- Parameters
-
| event | The constant reference to the event structure to be sent. |
Implements svcs::services::ISubject.
◆ notify() [2/2]
| void svcs::test::core::MockSubject::notify |
( |
const Event & | event | ) |
const |
|
inlineoverridevirtual |
Notifies all attached observers about an event.
This method is made public so that component classes (like ObjectStorage) can publish events through the injected ISubject pointer. The method is declared as const because event notification is a logically non-mutating action on the Subject's state.
- Parameters
-
| event | The constant reference to the event structure to be sent. |
Implements svcs::services::ISubject.
The documentation for this class was generated from the following files: