class DynamicSkeleton

DynamicSkeleton is used to dynamically implement an interface (i. More...

Full nameArts::DynamicSkeleton
Definition#include <arts/dynamicskeleton.h>
Template formDynamicSkeleton<class Parent_skel>
InheritsArts::DynamicSkeletonBase [public ], Parent_skel (unknown) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

DynamicSkeleton is used to dynamically implement an interface (i.e. without static type bindings as generated by the MCOP idl compiler.

You will always implement a mixed version: mcopidl generated skeletons up to a certain point, and above this, dynamically implemented interfaces. So you'll inherit DynamicSkeleton<Static_skel> and give the interface you want to implement dynamically as argument. Suppose your idl file looks like


 interface A { void a(); };
 interface B : A { void b(); };

And you want to implement interface A "classic" (i.e. with mcopidl generated virtual void a()) and interface B "dynamic", you would do


 typedef Arts::DynamicSkeleton<A_skel> A_dskel;   // convenient with typedef

 class B_impl : public A_dskel {
 public:
   B_impl() : A_dskel("B") {  // we dynamically implement the B interface
   }
   void a() { // through A_skel
     arts_info("a called");
   }
   void process(long methodID, Arts::Buffer *request, Arts::Buffer *result)
   {
	   const Arts::MethodDef& methodDef = getMethodDef(methodID);
	 
	   if(methodDef.name == "b")
	     arts_info("b called!");
	   else
	     arts_fatal("Unknown method '%s' called");
	 }
 };

 DynamicSkeleton (const std::string& interface)

DynamicSkeleton

constructor

const MethodDef&  getMethodDef (long methodID)

getMethodDef

getMethodDef returns a MethodDef structure for a given methodID - it is quite usefull if you implement process


 void process(long methodID, Arts::Buffer *request, Arts::Buffer *result)
 {
   const Arts::MethodDef& methodDef = getMethodDef(methodID);
 
	 if(methodDef.name == "hello") // the method named hello was called
	   printf("Hello!\n");
	 else                          // method with other name was called
	   arts_fatal("Method '%s' not implemented",methodDef.name.c_str());
 }

std::string  _interfaceName ()

_interfaceName

bool  _isCompatibleWith (const std::string& interfacename)

_isCompatibleWith

void  _buildMethodTable ()

_buildMethodTable


Generated by: stefan on stefan on Sat Jun 2 23:13:28 2001, using kdoc 2.0a53.