[omniORB] IDL semantics of event publication (including eventpayload)

Tom O'Reilly oreilly at mbari.org
Wed Sep 19 10:13:12 BST 2007


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. 

I am thinking of something like this:

module auv {

  interface Navigation {

    struct Position {
      float latitude;
      float longitutde;
      float altitude;
    };

    // Synchronous operation to get vehicle position
    void getPosition(out Position p);

    // A PositionEvent is published by the navigation service when it computes a new
    // vehicle position. 
    struct PositionEvent {

      // Subscribers should filter on this name
      const string name = "PositionEvent";

      // Position object is the event payload
      Position payload;
    };

    // The servant must implement a method to publish PositionEvents to 
    // COSNotification. NOTE: clients that want positional information will never 
    // call this event! Instead they will subscribe to 
    void publishPayload(in PositionEvent);
  };
};

 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.

Is this a reasonable approach? Does anyone else worry about this kind of situation?

Thanks,
Tom



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070919/a9389c5b/attachment.htm


More information about the omniORB-list mailing list