English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2007-01-15 05:07:20 · 2 answers · asked by as 2 in Computers & Internet Other - Computers

2 answers

http://www.xtremes.math.uni-siegen.de/risktecman/node31.html please visit this link

2007-01-15 10:44:28 · answer #1 · answered by Raju M 2 · 0 0

Interface Definition

The interface definition of the RiskTec server contains two classes. The first one is a factory class that produces the components. The second one describes the actual components, which implement the Prototype Pattern [1].

We start with the IDL declaration of the components.

module XGPLNodes {

enum TPortType { PORT_GENERIC, PORT_INT, PORT_REAL, PORT_REAL2,
PORT_REAL3, PORT_STRING, PORT_DATA,
PORT_MATRIX};

struct TReal2 { double x; double y; };
struct TReal3 { double x; double y; double z; };

typedef sequence doubleseq;
typedef sequence doublematrix;

interface TXGPLNode {
string Name ();
string Description ();

TXGPLNode Clone ();

long GetNumberOfInports ();
TPortType GetInportType (in long Nr);
long GetNumberOfOutports ();
TPortType GetOutportType (in long Nr);

void SetInport (in long Nr, in any x);
void SetInportData (in long Nr, in doubleseq x);
void SetInportMatrix (in long Nr, in doublematrix x);
any GetOutport (in long Nr);
doubleseq GetOutportData (in long Nr);
doublematrix GetOutportMatrix (in long Nr);

void Perform ();

void Destroy ();
};
};

Components are identified by means of a character string that is returned by their Name method. That string is used to select an operation when employing the shared library/DLL. The Description method returns a longer string describing the operation of the node. That text is used as a menu option in the XGPL system. Since components implement the Prototype pattern, they provide a Clone method that creates a new object of the same type.

The next four methods describe the number and type of input and output parameters of a component.

A client utilizes a component by

1. setting its input parameters using the methods SetInport, SetInportData and SetInportMatrix,
2. calling the Perform method and
3. retrieving the result with the methods GetOutport, GetOutportData and GetOutportMatrix.

When a component is no longer needed, it should be deleted using its Destroy operation to free up server resources.

A client obtains a reference to a component object by invoking operations on a factory with the following IDL definition.

module XGPLNodes {
interface TNodeFactory {
TXGPLNode ProduceNode (in string name);
void RegisterNode (in TXGPLNode node);
string GetFirstNodeName ();
string GetNextNodeName ();
long GetNumberOfNodes ();
};
};

The string that is returned by the Name operation of a component is used to request the creation of such a component by the factory object. Moreover, the factory is able to list the names of the components it can produce.

The InsertPrototype method registers the prototype of a component with the factory. These prototypes may be implemented in different software systems, running on different hosts.

When Xtremes is started with the -server filename option, it

1. creates a factory object,
2. creates prototypes of all its components,
3. registers them with the factory and
4. writes a stringified object reference of the factory object to the given filename.

2007-01-15 20:01:30 · answer #2 · answered by elvisjohn 7 · 0 0

fedest.com, questions and answers