IPDL/Getting started: Difference between revisions

Line 125: Line 125:


=== Direction ===
=== Direction ===
As introduced above, message direction specifiers simply denote which actor sends the message and which receives it.  The following artificial example should make it clear what the '''out''', '''in''', and '''inout''' direction specifiers mean to the C++ implementors.
  // this protocol ...
  protocol Direction {
      out Foo();
      in Bar();
      inout Baz();
  }; 
  // ... generates these C++ abstract classes ...
  // ----- DirectionProtocolParent.h -----
  class DirectionProtocolParent {
  protected:
      void RecvBar();
      void RecvBaz();
 
  public:
      void SendFoo() { /* boilerplate */ }
      void SendBaz() { /* boilerplate */ }
  };
  // ----- DirectionProtocolChild.h -----
  class DirectionProtocolParent {
  protected:
      void RecvFoo();
      void RecvBaz();
 
  public:
      void SendBar() { /* boilerplate */ }
      void SendBaz() { /* boilerplate */ }
  };


=== Semantics ===
=== Semantics ===
Confirmed users
699

edits