Package OpenCAGE.GIF.Factories

Factories that build Graph_Models

Class Specific_Model_Factory

throws Invalid_File .

An abstract class for a factory, which can build a hierarchical graph from a file. If you want OpenCAGE to understand a specific file format, you have to build another factory, which inherits from this class


public Boolean Is_Applicable( Ada.Strings.Unbounded.Unbounded_String Filename);

Returns true if this factory can handle the file specified by the given filename, false otherwise. Avoid to check to whole file within this method, some expect this to be a lightweight method (in terms of time and space). So check only the headers and some other characteristical properties of the file format (if possible). File corruption can be reported at Open_File().

public OpenCAGE.GIF.Root_Node_Models.Root_Node_Model Open_File( Ada.Strings.Unbounded.Unbounded_String Filename);

Opens the file specified by the given filename, creates a hierarchical interpretation and returns it. If the factory cannot handle this file (eg for file corruption), this procedure throws a "Invalid_File" Exception

public OpenCAGE.GIF.Factories.Specific_Model_Factory Create(void);

Create a new factory and return it.