Main Page | Class List | Directories | File List | Class Members | File Members

ObitRPC.h File Reference

ObitRPC Remote Procedure Call class. More...

#include <xmlrpc_client.h>
#include <xmlrpc_server.h>
#include <xmlrpc_server_abyss.h>
#include "Obit.h"
#include "ObitErr.h"
#include "ObitXML.h"

Go to the source code of this file.

Classes

struct  ObitRPC
 ObitRPC Class structure. More...
struct  ObitRPCClassInfo
 ClassInfo Structure. More...

Defines

#define ObitRPCUnref(in)   ObitUnref (in)
 Macro to unreference (and possibly destroy) an ObitRPC returns a ObitRPC*.
#define ObitRPCRef(in)   ObitRef (in)
 Macro to reference (update reference count) an ObitRPC.
#define ObitRPCIsA(in)   ObitIsA (in, ObitRPCGetClass())
 Macro to determine if an object is the member of this or a derived class.

Typedefs

typedef ObitRPC *(* ObitRPCCreateClientFP )(gchar *name, ObitErr *err)
 Typedef for definition of class pointer structure.
typedef ObitRPC *(* ObitRPCCreateServerFP )(gchar *name, ObitErr *err)
 Typedef for definition of class pointer structure.

Enumerations

enum  obitRPCType { OBIT_RPC_Client = 0, OBIT_RPC_Server }
 enum for object type. More...
enum  obitRPCRequestType {
  OBIT_RPC_Request_Continue = 0, OBIT_RPC_Request_Abort, OBIT_RPC_Request_Quit, OBIT_RPC_Request_NoTV,
  OBIT_RPC_Request_Field, OBIT_RPC_Request_EditWin
}
 enum for request sent from server back to client This list needs to be compatible with #ObitDisplayRequest defined in ObitDisplay.h More...

Functions

void ObitRPCClassInit (void)
 Public: Class initializer.
ObitRPCnewObitRPC (gchar *name)
 Public: Default Constructor.
ObitRPCObitRPCCreateClient (gchar *name, ObitErr *err)
 Public: Create/initialize client ObitRPC structures.
ObitRPCObitRPCCreateServer (gchar *name, ObitErr *err)
 Public: Create/initialize server ObitRPC structures.
gconstpointer ObitRPCGetClass (void)
 Public: ClassInfo pointer.
ObitXMLObitRPCCall (ObitRPC *client, gchar *serverURL, ObitXML *arg, ObitInfoList **status, ObitInfoList **request, ObitErr *err)
 Public: Send RPC request.
void ObitRPCAddMethod (ObitRPC *server, gchar *method_name, xmlrpc_method method, gpointer user_data, ObitErr *err)
 Add method callback to server.
void ObitRPCServerLoop (ObitRPC *server, gint port, gchar *log_file)
 Start Server loop.


Detailed Description

ObitRPC Remote Procedure Call class.

This class is derived from the Obit class. Related functions are in the ObitRPCUtil module.

This class handles Remote Procedure Calls. The implementation is based on xmlrpc which only allows a single client or server handler at a time.

Creators and Destructors

An ObitRPC will usually be created using ObitRPCCreate which allows specifying a name for the object as well as other information.

A copy of a pointer to an ObitRPC should always be made using the ObitRPCRef function which updates the reference count in the object. Then whenever freeing an ObitRPC or changing a pointer, the function ObitRPCUnref will decrement the reference count and destroy the object when the reference count hits 0. There is no explicit destructor.


Define Documentation

#define ObitRPCIsA in   )     ObitIsA (in, ObitRPCGetClass())
 

Macro to determine if an object is the member of this or a derived class.

Returns TRUE if a member, else FALSE in = object to reference

#define ObitRPCRef in   )     ObitRef (in)
 

Macro to reference (update reference count) an ObitRPC.

returns a ObitRPC*. in = object to reference

#define ObitRPCUnref in   )     ObitUnref (in)
 

Macro to unreference (and possibly destroy) an ObitRPC returns a ObitRPC*.

in = object to unreference


Typedef Documentation

typedef ObitRPC*(* ObitRPCCreateClientFP)(gchar *name, ObitErr *err)
 

Typedef for definition of class pointer structure.

typedef ObitRPC*(* ObitRPCCreateServerFP)(gchar *name, ObitErr *err)
 

Typedef for definition of class pointer structure.


Enumeration Type Documentation

enum obitRPCRequestType
 

enum for request sent from server back to client This list needs to be compatible with #ObitDisplayRequest defined in ObitDisplay.h

Enumeration values:
OBIT_RPC_Request_Continue  Continue the program.
OBIT_RPC_Request_Abort  Abort the program.
OBIT_RPC_Request_Quit  Quit - graceful shutdown.
OBIT_RPC_Request_NoTV  Stop displaying intermediate results.
OBIT_RPC_Request_Field  Send another field in the current mosaic.
OBIT_RPC_Request_EditWin  Edit Clean window in current field.

enum obitRPCType
 

enum for object type.

This specifies which known type of RPC object

Enumeration values:
OBIT_RPC_Client  Client.
OBIT_RPC_Server  Server.


Function Documentation

ObitRPC* newObitRPC gchar *  name  ) 
 

Public: Default Constructor.

Initializes class if needed on first call.

Parameters:
name An optional name for the object.
Returns:
the new object.

void ObitRPCAddMethod ObitRPC server,
gchar *  method_name,
xmlrpc_method  method,
gpointer  user_data,
ObitErr err
 

Add method callback to server.

Parameters:
server Server ObitRPC
method_name name of the method
method function pointer to xmlrpc_method callback
user_data Additional data to be passed to method, may be NULL
err Obit Error message

ObitXML* ObitRPCCall ObitRPC client,
gchar *  serverURL,
ObitXML arg,
ObitInfoList **  status,
ObitInfoList **  request,
ObitErr err
 

Public: Send RPC request.

Parameters:
client Client ObitRPC
serverURL URL of service, e.g. "http://localhost:8765/RPC2"
arg Argument of call (includes method name )
status [out] if non NULL, Status in form of Info list, entries "code", "reason" Should be Unrefed when done
request [out] if non NULL, Any in form of Info list, entries "code", and case dependent parameters. Returns NULL if no request Should be Unrefed when done
err Obit Error message
Returns:
XML object returned, NULL on communications failure, even if this is defined the function may have failed.

void ObitRPCClassInit void   ) 
 

Public: Class initializer.

ObitRPC* ObitRPCCreateClient gchar *  name,
ObitErr err
 

Public: Create/initialize client ObitRPC structures.

Parameters:
name An optional name for the object.
err Obit Error message
Returns:
the new object.

ObitRPC* ObitRPCCreateServer gchar *  name,
ObitErr err
 

Public: Create/initialize server ObitRPC structures.

Parameters:
name An optional name for the object.
err Obit Error message
Returns:
the new object.

gconstpointer ObitRPCGetClass void   ) 
 

Public: ClassInfo pointer.

Returns:
pointer to the class structure.

void ObitRPCServerLoop ObitRPC server,
gint  port,
gchar *  log_file
 

Start Server loop.

Parameters:
server Server ObitRPC
port Port number to listen to
logging file, NULL=>/tmp/xmlrpc_log


Generated on Fri Aug 31 22:13:07 2007 for Obit by  doxygen 1.3.9.1