Critical Link MityCam SoC Firmware  1.0
Critical Link MityCam SoC Firmware
RegisterFileObserver.h
Go to the documentation of this file.
1 #ifndef REGISTERFILEOBSERVER_H
2 #define REGISTERFILEOBSERVER_H
3 
4 #include <unordered_map>
5 #include <vector>
6 
8 public:
15  virtual void notifyRead(int64_t anAddr, int64_t anOffset, int64_t anLen) const = 0;
16 };
17 
19 public:
21  virtual ~tcRegisterFileObservable();
22 
28  void registerReadObserver(int64_t anAddr, tcRegisterFileObserver *apObserver);
29 
34  void unregisterReadObserver(int64_t anAddr, tcRegisterFileObserver *apObserver);
35 
42  void notifyRead(int64_t anAddr, int64_t anOffset, int64_t anLen) const;
43 
44 protected:
45  std::unordered_map< int64_t, std::vector< tcRegisterFileObserver* > > readObservers;
46 };
47 
48 #endif // REGISTERFILEOBSERVER_H
tcRegisterFileObserver
Definition: RegisterFileObserver.h:7
tcRegisterFileObservable::tcRegisterFileObservable
tcRegisterFileObservable()
Definition: RegisterFileObserver.cpp:6
tcRegisterFileObservable::~tcRegisterFileObservable
virtual ~tcRegisterFileObservable()
Definition: RegisterFileObserver.cpp:11
tcRegisterFileObservable::unregisterReadObserver
void unregisterReadObserver(tcRegisterFileObserver *apObserver)
unregisterReadObserver Unregister the observer from pre-read notificatons
Definition: RegisterFileObserver.cpp:21
tcRegisterFileObservable
Definition: RegisterFileObserver.h:18
tcRegisterFileObservable::notifyRead
void notifyRead(int64_t anAddr, int64_t anOffset, int64_t anLen) const
notifyRead
Definition: RegisterFileObserver.cpp:41
tcRegisterFileObservable::readObservers
std::unordered_map< int64_t, std::vector< tcRegisterFileObserver * > > readObservers
Definition: RegisterFileObserver.h:45
tcRegisterFileObservable::registerReadObserver
void registerReadObserver(int64_t anAddr, tcRegisterFileObserver *apObserver)
registerReadObserver - Register an observer for pre-read notifications
Definition: RegisterFileObserver.cpp:16
tcRegisterFileObserver::notifyRead
virtual void notifyRead(int64_t anAddr, int64_t anOffset, int64_t anLen) const =0
notifyRead - a pre-read notification hook