<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16525" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2>Tuser and Renny, you are both correct of course.
The event "payload" object is packed into a CORBA::Any by the publisher, and
unpacked by the subscriber, and my application successfully does this. But I was
hoping that I could use the navigation service IDL to express the publication
operation and various payload types in a way that is enforced by my
C++ compiler. After all, software developers need to know what is inside the
CORBA::Any payload. Documentation is one answer, but documentation can get
out-of-date or programmers forget to include it. The IDL itself seems the
ultimate documentation, since it is enforced at compile-time. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I am thinking of something like this:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT>
<DIV><FONT face="Courier New" size=2>module auv {</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2> interface Navigation {</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2> struct Position
{</FONT></DIV>
<DIV><FONT face="Courier New" size=2> float
latitude;</FONT></DIV>
<DIV><FONT face="Courier New" size=2> float
longitutde;</FONT></DIV>
<DIV><FONT face="Courier New" size=2> float
altitude;</FONT></DIV>
<DIV><FONT face="Courier New" size=2> };</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2> // Synchronous operation
to get vehicle position</FONT></DIV>
<DIV><FONT face="Courier New" size=2> void getPosition(out
Position p);</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2> // A PositionEvent is
published by the navigation service when it computes a new</FONT></DIV>
<DIV><FONT face="Courier New" size=2> // vehicle position.
</FONT></DIV>
<DIV><FONT face="Courier New" size=2> struct PositionEvent
{</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2> //
Subscribers should filter on this name</FONT></DIV>
<DIV><FONT face="Courier New" size=2> const string
name = "PositionEvent";</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2> // Position
object is the event payload</FONT></DIV>
<DIV><FONT face="Courier New" size=2> Position
payload;</FONT></DIV>
<DIV><FONT face="Courier New" size=2> };</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2> // The servant must
implement a method to publish PositionEvents to </FONT></DIV>
<DIV><FONT face="Courier New" size=2> // COSNotification.
NOTE: clients that want positional information will never </FONT></DIV>
<DIV><FONT face="Courier New" size=2> // call this event!
Instead they will subscribe to </FONT></DIV>
<DIV><FONT face="Courier New" size=2> void publishPayload(in
PositionEvent);</FONT></DIV>
<DIV><FONT face="Courier New" size=2> };</FONT></DIV>
<DIV><FONT face="Courier New" size=2>};</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV></DIV>
<DIV><FONT face=Arial size=2> The problem I see with this approach is that
potential client developers might be confused to see the publishPayload()
operation; this operation should never be called by most clients. Rather, I
define publishPayload() so that the service developer will be forced to
implement publication of PositionEvents.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Is this a reasonable approach? Does anyone else
worry about this kind of situation?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV><FONT face=Arial size=2>Tom</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> </DIV>
<DIV><BR></DIV></FONT></BODY></HTML>