Flip Reference

DocumentObserver Class Reference

Declared in

flip/DocumentObserver.h

template <class T>   class DocumentObserver;

flip::DocumentObserver is the base of document observers.

Template Parameters

T

The root class to observer. T must inherit from flip::Object

Member Functions Synopsys

document_changed

Receives document change notification

Member Functions

document_changed

virtual void   document_changed (T & root) = 0;

To receive document change notification, one will inherit from this class and implement this function. This function is then trigerred at commit or pull stage.

Example:

class MyObserver : public flip::DocumentObserver <MyRootClass>
{
public:
   virtual void   document_changed (MyRootClass & root) override;
};
void  MyObserver::document_changed (MyRootClass & root)
{
   if (root.changed ())
   {
      // ...
   }
}