View Single Post
  #1 (permalink)  
Old 12-21-2005
orphean orphean is offline
Registered User
 
 
Join Date: Dec 2005
Location: NY
Posts: 15
Send a message via Yahoo to orphean
-->
Dynamic dispatch demo

Hi.

I have a question regarding how to implement dynamic dispatch. I"m following the demo given in $ICE_HOME/demo/Ice/invoke/

I've taken out all the functions except one..

Here is my sample Dynamic.ice file

module Dynamic
{
struct Structure
{
string name;
int value;
};
sequence<Structure> StructureSeq;
interface Printer
{
void printStructSequence(StructureSeq seq);
};
};

I've also taken PrinterI.h and PrinterI.cpp and stripped it out for only my function printStructSequence (implemented ice_invoke())

now, in the demo, i've noticed two methods ice_writeStructureSeq and ice_readStructureSeq

do I have to implement this in Dynamic.cpp, or will slice2cpp do it for me..

I'm using slice2cpp like this

slice2cpp --stream Dynamic.ice

Right now, when compiling, I get the error

pradab@dagger:~/work/dynamic$./dynamic.bash
PrinterI.cpp: In member function `virtual bool PrinterI::ice_invoke(const
std::vector<Byte, std::allocator<Byte> >&, std::vector<Byte,
std::allocator<Byte> >&, const Ice::Current&)':
PrinterI.cpp:18: error: `ice_readStructureSeq' undeclared in namespace `Dynamic
'
DynamicClient.cpp: In member function `virtual int DynamicClient::run(int,
char**)':
DynamicClient.cpp:51: error: `ice_writeStructureSeq' undeclared in namespace `
Dynamic'
g++: PrinterI.o: No such file or directory
g++: DynamicClient.o: No such file or directory

thats cuz these two methods are not there in Dynamic.cpp (generated by slice2cpp)

Please help
__________________
Abhay Pradhan
Infosys Technologies Limited
Reply With Quote