Package FET

This package contains all classes, which are directly related to the FET pattern and paramter pots.

Class Data_Drain

This class defines an interface for setting parameters.

Operations

public Set ( FET.Parameter_Pot New_Parameter );

Set the parameter_pot of the data_drain

public FET.Parameter_Pot Get (void);

Return the parameter_pot of the data_drain

public Merge ( FET.Parameter_Pot With_Pot );

Merge the pot of the data_drain with the given parameter_pot

Class Data_Gate

This class distributes parameters from the attached Data_Source to the attached Data_Drains.

Attributes

private FET.Data_Source Data_Source 

The Data_Source this Parameter Pot (PP) gets the parameters from.

private FET.Data_Drains_Lists.List Data_Drain_List 

A list of Data Drain (DD) to which the parameters will be provided.

Operations

public FET.Data_Gate Create (void);

Create and return a new Data_Gate.

public Link_Data_Source ( FET.Data_Source New_Data_Source );

Set the Data_Gate's Data_Source property to the given Data_Source.

public Add_Data_Drain ( FET.Data_Drain New_Data_Drain );

Add a Data_Drain to the Data_Gate.

public Distribute (void);

Get parameters from the Data_Source and distribute it to the attached Data_Drains.

Class Data_Source

This class defines an interface for getting parameters. If another Data_Source is attached, the request is also delegated to this Data_Source.

Operations

public FET.Parameter_Pot Get (void);

Return the parameter pot of this data_source

Class Deserializer

An abstract base class for deserialization

Operations

public FET.Pot_Element Deserialize ( OpenCAGE.General.XML.Node_Ptr XML );

Deserialize a XML-structure to a pot element

Class Parameter_Pot

throws Invalid_Key_Exception , Incorrect_Type_Exception .

A Parameter Pot (PP) contains parameter informations in a wide sense. You can access these parameters directly by names (Unbounded_Strings). You have to know, of which type the parameter is, you are asking for. There is no type conversion done between the different types, eg. you cannot set a Integer under a certain key, and get it back as Unbounded_String with the same key. Every Name within a PP must be unique. If you ask with a certain Get for a parameter with a certain type, and in the PP exists this name with another type, you will get a Incorrect_Type_Exception.

Attributes

private FET.Parameter_Pot_Data_Source Self_Ds 

The Parameter Pot (PP)'s Data Source (DS)

private FET.Parameter_Pot_Data_Drain Self_Dd 

The Parameter Pot (PP)'s Data Drain (DD)

private FET.Data_Source Linked_Ds 

A Data Drain (DD) the Parameter Pot (PP) gets parameters from (for chaining Data Source (DS)es).

private FET.Hashing_Pot_Element.Mapping Hash 

The hash map for Unbounded_Strings

Operations

public FET.Parameter_Pot Create (void);

Create and return a new Parameter Pot (PP)

public FET.Data_Source Get_Data_Source (void);

Get the Parameter Pot (PP)'s Data Source (DS) implementation.

public FET.Data_Drain Get_Data_Drain (void);

Get the Parameter Pot (PP)'s Data Drain (DD) implementation.

public Link_Data_Source ( FET.Data_Source ds );

Chain another Data Source (DS) to the Parameter Pot (PP). If a parameter for a given key cannot be found in the Parameter Pot (PP), the request will be delegated to the linked Data Source (DS).

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

Get the parameter for the specified key as string.

public Set ( Ada.Strings.Unbounded.Unbounded_String Key , Ada.Strings.Unbounded.Unbounded_String Value , Boolean Overwrite := False );

Save the given string under the specified key.

public To_File ( String Filename );

Serializes the content of the Parameter Pot (PP) into a file

public Destroy (void);

Remove this object

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

Get the specified key as Boolean

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

Get the specified parameter as Integer

public Set ( Ada.Strings.Unbounded.Unbounded_String Key , Integer Value , Boolean Overwrite := False );

Save the given Integer under the given Key

public Set ( Ada.Strings.Unbounded.Unbounded_String Key , Boolean Value , Boolean Overwrite := False );

Save the given Boolean under the specified key

public Set ( Ada.Strings.Unbounded.Unbounded_String Key , FET.Pot_Element Value , Boolean Overwrite := False );

The standard method for putting a parameter into a Parameter_Pot. The parameter-pot acts like a hash-table

public FET.Pot_Element Get ( Ada.Strings.Unbounded.Unbounded_String Key );

The Standard-Method for asking a Parameter_Pot for a Parameter. The parameter pot acts like a hash-table.

public FET.Parameter_Pot Clone (void);

Create a clone of a parameter pot (but not of its pot elements; these are copied from the source

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

Check, if there is a pot element with this key

public OpenCAGE.General.XML.Node_Ptr To_XML (void);

Write the content into a XML structure

public Boolean Is_Valid (void);

Pots used for dialogs and the like that have to contain a information if the data contained in are valid. We use a key 'Valid' for this. But new Pots have no key valid. So use this method to get the information. It returns true, if 'Valid' does not exist in the Pot. If Is_Valid is true, the other informations in the pot can be used, else not (you guessed that).

public Boolean Is_Complete (void);

same as Is_Valid, but with the key 'Complete'. True means that all information that are needed are in the pot. I.e. for renaming a node a dialog has to be shown. In the pot is the old name of the node, Complete is false. The dialog has to be shown to change the name. If the pot is created by script, it is complete, so the dialog will not be shown.

Class Parameter_Pot_Data_Drain

extends FET.Data_Drain

A Parameter Pot (PP)-specific implementation of a Data Drain (DD).this class acts as an proxy to a Parameter_Pot

Attributes

private FET.Parameter_Pot Parameter_Pot 

The Parameter_Pot, this object is proxy for

Operations

public Destroy (void);

Destructor

private FET.Parameter_Pot_Data_Drain Create ( FET.Parameter_Pot Param_Pot );

Creates a Data_Drain Representation of the given Parameter_Pot

public Set ( FET.Parameter_Pot Pot );

public FET.Parameter_Pot Get (void);

Return the parameter_pot of the data_drain [This description is adopted from 'FET.Data_Drain'.]

public Merge ( FET.Parameter_Pot With_Pot );

merge a new parameter pot into the existing one (self.parameter_pot); if some keys are double (containted in both paramter pots), the already existing (in self.parameter) is maintained, the other is dropped. The resulting paramter pot is stored in self.paramter_pot.

Class Parameter_Pot_Data_Source

extends FET.Data_Source

A Parameter Pot (PP)-specific implementation of a Data Source (DS).

Attributes

private FET.Parameter_Pot Param_Pot 

The Parameter_Pot, this object is proxy for

Operations

public FET.Parameter_Pot Get (void);

Return the Parameter_Pot

private FET.Parameter_Pot_Data_Source Create ( FET.Parameter_Pot Param_Pot );

Creates a Data_Source Representation of the given Parameter_Pot

public Destroy (void);

Destructor

Class Pot_Element

This class encapsulates a OpenCAGE-Object, which then can be filled into a Parameter_Pot. For every class, you want to put into a Parameter_Pot, you have to build a subclass of this abstract class

Operations

public OpenCAGE.General.XML.Node_Ptr Serialize (void);

Serializes the content of this Pot_Element into XML