Skip to content

Draft: Introduction of IDL6 for distributed call identifier and depth

Nicolas Leclercq requested to merge distributed_call_id into main

The proposed MR introduces the version 6 of the Tango CORBA interface (a.k.a, IDL6).

The main motivation is the support the distributed call identifier and depth for which we need to be able to distinguish between an IDL<=5 and and IDL6 peer in the communication between Tango entities - notably between a client and the server it communicate with.

The proposed modifications are totally transparent for any Tango device or client compiled with a pre-IDL6 version of Tango or that doesn't make use of the new feature(s). Here we simply extend an existing and dedicated data structure used to exchange some information related to the client identification: ClntIdent - a CORBA union which content is specified by the (badly named) LockerLanguage enum. In order to respect the naming convention used for the previous IDL versions, new names are suffixed by "_6".

The Device_Impl6 interface is an empty shell inheriting from Device_Impl5. There's consequently no irreversible contract here. We will be free to add new feature to Tango with this new IDL6. The only critical here is to validate taht we don't need more than distributed call identifier and depth in the new CppClntIdent_6 data structure.

//-------------------------------------------------------------------------
//
// 		Data types for client identification
//
//-------------------------------------------------------------------------

typedef	unsigned long long  JavaUUID[2];
typedef unsigned long CppClntIdent;
typedef	unsigned long long  CallId;
typedef	unsigned long CallDepth;  

struct JavaClntIdent
{
  string MainClass;
  JavaUUID uuid;
};

//-------------------------------------------------------------------------
// CppClntIdent extension for IDL 6
//-------------------------------------------------------------------------
// - cpp_clnt: data structure introduced in IDL 4 for C++ clients
// - call_id: the distributed call identifer (ulonglong)
// - call_depth: the distributed call depth along the call stack (ulong)
//-------------------------------------------------------------------------
struct CppClntIdent_6
{
  CppClntIdent cpp_clnt;
  CallId call_id;
  CallDepth call_depth; 
};

//-------------------------------------------------------------------------
// JavaClntIdent extension for IDL 6
//-------------------------------------------------------------------------
// - java_clnt: data structure introduced in IDL 4 for Java clients
// - call_id: the distributed call identifer (ulonglong)
// - call_depth: the distributed call depth along the call stack (ulong)
//-------------------------------------------------------------------------
struct JavaClntIdent_6
{
  JavaClntIdent java_clnt;
  CallId call_id;
  CallDepth call_depth;
};

//-------------------------------------------------------------------------
// the LockerLanguage enum (badly named for historical reasons)
//-------------------------------------------------------------------------
// a selector for the marshalling/demarshalling of the ClntIdent union
// - CPP: pre-IDL6 data structure for C++ clients
// - JAVA: pre-IDL6 data structure for Java clients
// - CPP_6: IDL6 data structure for C++ clients
// - JAVA_6: IDL6 data structure for Java clients
//-------------------------------------------------------------------------
enum LockerLanguage {CPP, JAVA, CPP_6, JAVA_6};

//-------------------------------------------------------------------------
// ClntIdent: a CORBA union providing the client identification
//-------------------------------------------------------------------------
union ClntIdent switch (LockerLanguage)
{
// pre-IDL6 data structure for C++ clients
case CPP:
  CppClntIdent cpp_clnt;
// pre-IDL6 data structure for Java clients
case JAVA:
  JavaClntIdent java_clnt;
// IDL6 data structure for C++ clients
case CPP_6:
  CppClntIdent_6 cpp_clnt_6;
// IDL6 data structure for Java clients
case JAVA_6:
  JavaClntIdent_6 java_clnt_6;
};

//-------------------------------------------------------------------------
//
//		The Device_6 interface (corresponding to Tango V9)
//
//-------------------------------------------------------------------------

interface Device_6: Device_5
{
	// Just a new interface allowing to "tag" a device as V6 
	// Required by the extension of ClntIdent 
};
Edited by Nicolas Leclercq

Merge request reports