Giri's C++ Support Library
C++ library providing everything you need to quickly create awesome applications.
giri::Observer< U > Class Template Referenceabstract

Observer class. Inherited classes can observe all classes which inherit from Observable. More...

#include <Observer.h>

Inheritance diagram for giri::Observer< U >:
Collaboration diagram for giri::Observer< U >:

Public Member Functions

virtual void update (std::shared_ptr< U > observable)=0
 

Additional Inherited Members

- Public Types inherited from giri::Object< Observer< U > >
using SPtr = std::shared_ptr< Observer< U > >
 
using UPtr = std::unique_ptr< Observer< U > >
 
using WPtr = std::weak_ptr< Observer< U > >
 

Detailed Description

template<typename U>
class giri::Observer< U >

Observer class. Inherited classes can observe all classes which inherit from Observable.

Example Usage:

#include <Observer.h>
#include <string>
#include <iostream>
using namespace giri;
class MyObservable : public Observable<MyObservable>
{
public:
std::string GetObservable() const {return "Observable ;)"; };
using SPtr = std::shared_ptr<MyObservable>;
using UPtr = std::unique_ptr<MyObservable>;
using WPtr = std::weak_ptr<MyObservable>;
};
// ... example to be continued at Observable class documentation
Observer/Obersvable Pattern implementation.
Namespace for giri's C++ support library.
Definition: Base64.h:47

Member Function Documentation

◆ update()

template<typename U >
virtual void giri::Observer< U >::update ( std::shared_ptr< U >  observable)
pure virtual

Called by Observable on notify.

Parameters
observableObject that triggered the update.

The documentation for this class was generated from the following file: