Package OpenCAGE.GIF.Simple

Simple implementation for the observer registering and updating and notifying for Edge_Model and Node_Model. These may be replaced if more complex implementations are necessary or a underlying graph model implementation provides already this functionality.

Class Simple_Edge_Model

extends OpenCAGE.GIF.Edge_Model

Attributes

private OpenCAGE.GIF.Simple.Edge_Model_Observers_Lists.List Observers 

The attached observers to update when this model changed.

Operations

public Attach( OpenCAGE.GIF.Edge_Model_Observer Observer);

Attach the given observer to the observer list. [This description is adopted from 'OpenCAGE.GIF.Edge_Model'.]

public Detach( OpenCAGE.GIF.Edge_Model_Observer Observer);

Detach the given observer from the observer list. [This description is adopted from 'OpenCAGE.GIF.Edge_Model'.]

public OpenCAGE.GIF.Node_Model Get_Start_Node(void);

Returns the start node of the edge.

public OpenCAGE.GIF.Node_Model Get_End_Node(void);

Returns the end node of the edge.

public Ada.Strings.Unbounded.Unbounded_String Get_Annotation( Ada.Strings.Unbounded.Unbounded_String Key);

Get a node annotation.

public Set_Annotation( Ada.Strings.Unbounded.Unbounded_String Key, Ada.Strings.Unbounded.Unbounded_String Value);

Set a node annotation. If it exists already, it is updated, else it is created.

public Boolean Get_Annotation( Ada.Strings.Unbounded.Unbounded_String Key);

Get a node annotation.

public Set_Annotation( Ada.Strings.Unbounded.Unbounded_String Key, Boolean Value);

Set a node annotation. If it exists already, it is updated, else it is created.

public Integer Get_Annotation( Ada.Strings.Unbounded.Unbounded_String Key);

Get a node annotation.

public Set_Annotation( Ada.Strings.Unbounded.Unbounded_String Key, Integer Value);

Set a node annotation. If it exists already, it is updated, else it is created.

public Notify_Changed(void);

Observer-Pattern. This method is protected, i.e. it should not be called from outside. Unfortunatly Ada doesn't support this feature.

Postcondition: all attached Observers are notified

public Notify_Destroying(void);

Observer-Pattern. This method is protected, i.e. it should not be called from outside. Unfortunatly Ada doesn't support this feature.

Postcondition: all attached Observers are notified

Class Simple_Node_Model

extends OpenCAGE.GIF.Node_Model

Attributes

private OpenCAGE.GIF.Node_Model Parent 

The parent of this node.

private Boolean Leaf 

true if this node is a leaf, false otherwise

private OpenCAGE.GIF.Simple.Node_Model_Observers_Lists.List Observers 

The attached observers to update when this model changed.

private Boolean Events_Enabled 

Events are only sent, when this is set to True (which is the default)

Operations

public Attach( OpenCAGE.GIF.Node_Model_Observer Observer);

Attach the given observer to the observer list. [This description is adopted from 'OpenCAGE.GIF.Node_Model'.]

public Detach( OpenCAGE.GIF.Node_Model_Observer Observer);

Detach the given observer from the observer list. [This description is adopted from 'OpenCAGE.GIF.Node_Model'.]

public Notify_Changed(void);

Observer-Pattern. This method is protected, i.e. it should not be called from outside. Unfortunatly Ada doesn't support this feature.

Postcondition: all attached Observers are notified

public Notify_Child_Added( OpenCAGE.GIF.Node_Model Child_Node);

Observer-Pattern. This method is protected, i.e. it should not be called from outside. Unfortunatly Ada doesn't support this feature.

Postcondition: all attached Observers are notified

public Notify_Child_Removed( OpenCAGE.GIF.Node_Model Child_Node);

Observer-Pattern. This method is protected, i.e. it should not be called from outside. Unfortunatly Ada doesn't support this feature.

Postcondition: all attached Observers are notified

public Notify_Destroying(void);

Observer-Pattern. This method is protected, i.e. it should not be called from outside. Unfortunatly Ada doesn't support this feature.

Postcondition: all attached Observers are notified

public Notify_Incoming_Edge_Added( OpenCAGE.GIF.Edge_Model New_Edge);

Observer-Pattern. This method is protected, i.e. it should not be called from outside. Unfortunatly Ada doesn't support this feature.

Postcondition: all attached Observers are notified

public Notify_Outgoing_Edge_Added( OpenCAGE.GIF.Edge_Model New_Edge);

Observer-Pattern. This method is protected, i.e. it should not be called from outside. Unfortunatly Ada doesn't support this feature.

Postcondition: all attached Observers are notified

public Notify_Incoming_Edge_Removed( OpenCAGE.GIF.Edge_Model Old_Edge);

Observer-Pattern. This method is protected, i.e. it should not be called from outside. Unfortunatly Ada doesn't support this feature.

Postcondition: all attached Observers are notified

public Notify_Outgoing_Edge_Removed( OpenCAGE.GIF.Edge_Model Old_Edge);

Observer-Pattern. This method is protected, i.e. it should not be called from outside. Unfortunatly Ada doesn't support this feature.

Postcondition: all attached Observers are notified

public Destroy_Children( OpenCAGE.GIF.Node_Models_Lists.List List);

Destroys all node models in the given list. This method is protected. ATTENTION: We assume that all children are derived from Simple_Node_Model. If you use your very own implementation, don't call this method!

public Enable_Events(void);

Enables the events. This method is protected, i.e. it should not be called from outside. Unfortunatly Ada doesn't support this feature.

public Disable_Events(void);

Disables the events. This method is protected, i.e. it should not be called from outside. Unfortunatly Ada doesn't support this feature.