THE LIBGOMD LIBRARY:
Application Program Interfaces (APIs)


AUTHOR: Gian Paolo "rejected" Ghilardi, GOMD Team
DATE: April, the 10th 2004
DOCUMENT VERSION: 1.0



Introduction

The libgomd library provides a small number of functions (6) used to interact with a local or remote gomd daemon (so you don't need to care about the socket communication stuff).

At this moment the libgomd library provides an handy C++ class, called "libgomd", for this purpose.
Standard "pure C" functions will be implemented soon as wrapper to this .

Check out the examples in contrib/c++ directory (you need to grab CVS code) to see how to use this class.


Libgomd Class Diagram (UML)

This is how the library looks from inside.











List of Methods

The libgomd class provides these six functions (methods).

Methods' Details.


Method:

bool libgomd::openConn (string remoteGomdIP, int port)

Purpose:

open a connection with a remote gomd daemon: require the IP and the port for the remote gomd daemon

Note:

no one




Method:

string libgomd:: closeConn()

Purpose:

closes an open connection with a remote gomd daemon

Note:

check if a connection with a remote gomd daemon is open




Method:

string libgomd::getInfo(string infoToRequest)

Purpose:

uses an open connection to ask remote gomd daemon about an oM (or system) information

Note:

check if a connection with a remote gomd daemon is open




Method:

string libgomd::getMultilineInfo(string infoToRequest, string endMsg)

Purpose:

uses an open connection to ask remote gomd daemon about an oM (or system) information. The received answer is splitted on several lines: this function will merge each line to get a single output string. The endMsg string indicates the end of the multiline answer.

Note:

check if a connection with a remote gomd daemon is open




Method:

string libgomd:: getInfoAndCloseConn(string remoteGomdIP, int port, string infoToRequest)

Purpose:

open a connection to a remote gomd daemon, request an info and closes the connection.

Note:

used as a kind of "atomic function" (it uses openConn, getInfo and closeConn methods in sequence)



Method:

string libgomd:: getMultilineInfoAndCloseConn(string remoteGomdIP, int port, string infoToRequest, string endMsg)

Purpose:

open a connection to a remote gomd daemon, request an info and closes the connection. The received answer is splitted on several lines: this function will merge each line to get a single output string. The endMsg string indicates the end of the multiline answer.

Note:

used as a kind of "atomic function" (it uses openConn, getMultilineInfo and closeConn methods in sequence)