C mapping of PortableServer::Servant



Hi all,
	As far as I can tell, the 'Servant' mapping for C is way
behind the mapping for C++. I thought I'd write up my thoughts for the
list and invite comments.

Relevant specs and sections:
	CORBA spec (11.3.1 - the Servant IDL type)
	C mapping (1.26.4 - Servant Mapping)
	C++ mapping (1.36.1 - Mapping of PortableServer:Servant)
	C++ mapping (1.36.2 - Servant reference counting Mix-in)

	The first problem is that in section 11.3.1 it is clearly said
that the programmer should be able to override the default
implementations of get_interface, is_a and non_existent. This is not
allowed by the C mapping, at the moment.

	To fix this, I think the PortableServer_ServantBase__epv
should be expanded to have get_interface, is_a and non_existent
memebers.

	The second problem is that no equivalent of C++'s 'servant
reference counting mix-in' is provided in the C mapping. This, I
think, is a big hole in the mapping. The RefCountServantBase would be
very useful, and indeed, is the corrrect solution to the servant
destruction problems we were having with bonobo recently.

	So, I think the Servant Mapping should be expanded to be as
follows:

typedef void *PortableServer_Servant;

typedef struct PortableServer_ServantBase__epv {
	void                *_private
	void               (*finalize)      (PortableServer_Servant,
					     CORBA_Environment *);
	PortableServer_POA (*default_POA)   (PortableServer_Servant,
					     CORBA_Environment *);
	CORBA_InterfaceDef (*get_interface) (PortableServer_Servant,
					     CORBA_Environment *);
	CORBA_boolean      (*is_a)          (PortableServer_Servant,
					     const char *,
					     CORBA_Environment *);
	CORBA_boolean      (*non_existent)  (PortableServer_Servant,
					     CORBA_Environment *);
	void               (*add_ref)       (PortableServer_Servant,
					     CORBA_Environment *);
	void               (*remove_ref)    (PortableServer_Servant,
					     CORBA_Environment *);
	};

typedef PortableServer_ServantBase__epv
		PortableServer_RefCount_ServantBase__epv;

	Thoughts?

Cheers,
Mark.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]