DocumentObserver Class Reference
Declared in |
|
template <class T> class DocumentObserver; |
flip::DocumentObserver
is the base of document observers.
Template Parameters
| The root class to observer. |
Member Functions Synopsys
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 ()) |
{ |
// ... |
} |
} |