# Katabatic - Routing Toolbox

List of all members | Public Member Functions
Observer< T > Class Template Reference

Observer Design Pattern, Observer part. More...

Inheritance diagram for Observer< T >:
[legend]

## Public Member Functions
| Observer (const T *owner)
T * | getOwner () const
Public Member Functions inherited from BaseObserver
virtual void | notify (unsigned int flags)

## Detailed Description

### template<typename T>
class Katabatic::Observer< T >

Observer Design Pattern, Observer part.

First, a warning about names: although this class is named Observer, it is intended to be an attribute nested inside the whole object which is indeed, the true Observer. This nesting object is called, most of the time the owner in the following. But sometimes, for simplification it may also be called the Observer.

# Observer Implementation Notes

To retrieve the owner from the Observer attribute, we uses the offset from the attribute in the owner. This offset is computed once and for all the first time the template constructor is called.

## Constructor & Destructor Documentation

## ◆ Observer()

Observer | ( | const T * | owner | ) |
| inline

The owner of the oberver is needed to compute, on the first creation only, the offset of the Observer attribute inside the `owner` complete object.

## Member Function Documentation

## ◆ getOwner()

T * getOwner | ( |  | ) | const
| inline

Returns: The owner of the observer.

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

- Observer.h
- Observer.dox

Generated by doxygen 1.8.14 on Mon Feb 3 2020 | Return to top of page

Katabatic - Routing Toolbox | Copyright © 2008-2016 UPMC. All rights reserved