Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #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
  #2 (permalink)  
Old 12-21-2005
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
Hi,

When I copy your Slice definitions into a file and run 'slice2cpp --stream File.ice', the generated file File.cpp does contain the read/write functions. Are you sure that you are running slice2cpp correctly, and that your compiler is finding the correct version of the generated files?

Take care,
- Mark
Reply With Quote
  #3 (permalink)  
Old 12-21-2005
dwayne's Avatar
dwayne dwayne is offline
ZeroC Staff
 
Name: Dwayne Boone
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Jan 2005
Location: St. John's, Newfoundland
Posts: 209
Hi,

The ice_write/ice_read functions are generated by slice2cpp when you use the --stream option. Just take a look in your generated files (Dynamic.cpp|h). Regarding your compile error, are you sure that Dynamic.h is being included by your code?

Regards,
Dwayne
Reply With Quote
  #4 (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
-->
oopsss

am so sorry..

I was doing slice2cpp --stream on the command line..

but had completely forgotten about it on the Makefile!!


apoligies and thanks for the prompt help!
__________________
Abhay Pradhan
Infosys Technologies Limited
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamic replicaGroup registration Greenhippo Help Center 2 11-22-2006 05:18 AM
Dynamic Ice and Blobject (revisited) KE5CRP Help Center 7 04-21-2005 01:25 AM
Dynamic Ice and Blobject (IceStorm) KE5CRP Help Center 7 04-20-2005 02:20 PM
Dynamic type knowledge kovacm Help Center 2 01-28-2005 01:43 PM
dynamic link error diddek Bug Reports 2 02-18-2004 04:16 PM


All times are GMT -4. The time now is 10:33 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.