Bigger Example (UV Protocol)

<?xml version="1.0" ?>


<!-- xfer protocol description of xvalue message transfer protocol -->
<xfer>
<namespace name="xvalue"/>

<!-- xvalue protocol version -->
<version major="2" minor="1" />

<!-- access modes to files -->
<enum type="file_mode">
  <!-- client can read the file -->
  <member name="readonly">0x01</member>
  <!-- client can write the file -->
  <member name="readwrite">0x02</member>
  <!-- client can subscribe to file since mutable -->
  <member name="mutable">0x04</member>
</enum>

<!-- the coding of request replies -->
<enum type="request_code">
  <!-- request succeeds -->
  <member name="ok">0</member>
  <!-- request failed -->
  <member name="failed">1</member>
  <!-- request partly failed -->
  <member name="nak">2</member>
  <!-- service is offline  -->
  <member name="offline">3</member>
</enum>

<!-- description tags for the file modes -->
<!-- File Readable -->
<const type="string" >
  <value name="read_tag">Read</value>
</const>
<!-- File Writable -->
<const type="string" >
  <value name="write_tag">Write</value>
</const>
<!-- File Mutable -->
<const type="string" >
  <value name="mutable_tag">Mutable</value>
</const>

<subclasses>

<!-- Time stamp type -->
  <class type="time_t" >
    <!-- second component -->
    <item-of type="integer" name="sec" />
    <!-- nanosecond component -->
    <item-of type="integer" name="nsec" />
  </class>

<!-- Vector of booleans -->
  <class type="boolean_vector_t" >
    <list-of type="boolean" name="vector" />
  </class>


<!-- Vector of bytes -->
  <class type="byte_vector_t" >
    <list-of type="byte" name="vector" />
  </class>

<!-- Vector of integers -->
  <class type="integer_vector_t" >
    <list-of type="integer" name="vector" />
  </class>

<!-- Vector of longs -->
  <class type="long_vector_t" >
    <list-of type="long" name="vector" />
  </class>

<!-- Vector of floating point values -->
  <class type="fp_vector_t" >
    <list-of type="fp" name="vector" />
  </class>

<!-- Vector of strings -->
  <class type="string_vector_t" >
    <list-of type="string" name="vector" />
  </class>


 <!-- Folder type i.e. container for file entries. These files may again 
   represent folders (like the recursive structure of a file system hierachie).
   The folder type is a possible special type of the filevalue object. -->
  <class type="folder_t">
    <!-- Version info -->
    <item-of type="version_t" name="version" />
    <!-- Mivetype is a meta-tag to identify folder-structure -->
    <item-of type="string" name="mivetype"/>
    <!-- Filelist of folder entries -->
    <list-of type="file_t" name="file"/>
  </class>

 <!-- Version type as major and minor number -->
  <class type="version_t" >
    <!--  Major component -->
    <item-of type="integer" name="major" />
    <!--  Minor component -->
    <item-of type="integer" name="minor" />
  </class>

 <!-- Mount information for a client. It contains information
      to mount an UV-server.
      This type is  a possible special type of the filevalue object. -->
  <class type="mount_t">
    <!--  The mount info is supplied  tcp/ip or as servicename -->
    <item-of type="mountpoint_u" name="mountpoint"/>
  </class>

 <!-- Mount information as union of servicename and hostname:port -->
  <union type="mountpoint_u">
    <!-- Hostname:Port info -->
    <item-of type="mountip_t"      name="mountip"/>
    <!-- Servicename  -->
    <item-of type="string"         name="mountservice"/>
  </union>

 <!-- Mount information as host:port -->
  <class type="mountip_t">
    <!-- Hostname  -->
    <item-of type="string" name="host"/>
    <!-- TCP/IP-Port  -->
    <item-of type="integer" name="port"/>
  </class>

 <!-- Queue of objects: On server side any object put to queue is send to all 
      subscribers of the queue.
      This type is a possible special type of the filevalue object. -->
  <class type="queue_t">
    <!-- Version info -->
    <item-of type="version_t" name="version" />
    <!-- Mivetype is a meta-tag to identify queue-type -->
    <item-of type="string" name="mivetype"/>
    <!-- Queue Fills on server side -->
    <item-of type="integer"   name="counter"/>
    <!-- For internal usage in Client and Server -->
    <item-of type="native" name="handle"/>
  </class>

 <!-- Union of possible file values -->
  <union type="filevalue_u" >
    <!-- Boolean (logical) primitive type -->
    <item-of type="boolean" name="l"/>
    <!--  Byte primitive type -->
    <item-of type="byte" name="b"/>
    <!--  Integer primitive type -->
    <item-of type="integer" name="i" />
    <!--  Long primitive type -->
    <item-of type="long" name="g" />
    <!--  Floating point primitive type -->
    <item-of type="fp" name="d"/>
    <!--  Character String point primitive type -->
    <item-of type="string" name="s"/>

    <!--  Dynamically sized vector of boolan -->
    <item-of type="boolean_vector_t" name="lv"/>
    <!--  Dynamically sized vector of byte -->
    <item-of type="byte_vector_t" name="bv"/>
    <!--  Dynamically sized vector of integer -->
    <item-of type="integer_vector_t" name="iv" />
    <!--  Dynamically sized vector of long -->
    <item-of type="long_vector_t" name="gv" />
    <!--  Dynamically sized vector of floating point -->
    <item-of type="fp_vector_t" name="dv"/>
    <!--  Dynamically sized vector of character strings -->
    <item-of type="string_vector_t" name="sv"/>

    <!--  The filevalue of type object may be any object defined per xfer. Here it 
          will be used as a special filevalue type like folder, queue, mountpoint.   -->
    <item-of type="object" name="o" />

    <!-- 
      ...  
    <item-of type="..." name="..."/>
      ...  
    -->
    <!-- 
      do not delete dummy
    -->
    <item-of type="integer" name="dummy" />

  </union>

  <!-- Purpose of the file type is (beside providing other file properties) to map
       a name to a value. The value itself is either of primitive type (or arrays of them)
       or a folder (i.e. container) of other files or a mountpoint or queue.  -->
  <class type="file_t" >
    <!--  File name (without path) -->
    <item-of type="string"       name="name"/>
    <!--  Character string description of the file -->
    <item-of type="string"       name="description"/>
    <!--  File mode (read,write,mutable) -->
    <item-of type="integer"      name="mode" />
    <!--  Change time of file's value -->
    <item-of type="time_t"       name="time" />
    <!--  File owner: User Id as integer -->
    <item-of type="integer"      name="uid" />
    <!--  File owner: Group Id as integer -->
    <item-of type="integer"      name="gid" />
    <!--  For native usage in Server or Client  -->
    <item-of type="native"       name="userarg" />
    <!--  The subscribers (clients) of this file   -->
    <list-of type="subscriber_t" name="subscriber" />
    <!--  File value (union of primitive types or objects)  -->
    <item-of type="filevalue_u"  name="filevalue" />
  </class>



  <!-- Subscriber type -->
  <class type="subscriber_t">
    <!-- Character string identifier of subscriber -->
    <item-of type="string"      name="name" />
    <!-- For native usage in Client or Server -->
    <item-of type="native"      name="handle" />
    <!-- Under what condition the notification will be send to subscriber  -->
    <item-of type="condition_t" name="condition"/>
    <!-- Only for a filevalue of type floating we store the last value the server sent to this subscriber  -->
    <item-of type="fp" name="lastvalue"/>
  </class>

  <!-- File information with filepath to file. 
       Used for read-results or event data. -->
  <class type="data_t" >
    <!-- Path name of file -->
    <item-of type="string" name="filepath" />
    <!-- The file data itself -->
    <item-of type="file_t" name="file" />
  </class>

  <!-- Read result as reply to read request. -->
  <class type="result_t">
    <!-- Id of the read request -->
    <item-of type="integer"   name="id"/>
    <!-- List of read results -->
    <list-of type="data_t"    name="data"/>
  </class>

  <!-- Union of structure change types -->
  <union type="structure_u">
    <!-- a file is to add to folder or pushed to writable queue -->
    <item-of type="file_t"   name="add"/>
    <!-- a file to remove --> 
    <item-of type="boolean"  name="rm"/>
  </union>

  <!-- Tree structure change information -->
  <class type="structure_t">
    <!--  remove: remove filepath; 
          add/push:    file is added to filepath (writable folder 
                       or writable queue) -->
    <item-of type="string"        name="filepath"/>
    <!-- type and info of structure change -->
    <item-of type="structure_u"   name="u"/>
  </class>

  <!-- Multiple structure change informations,
       the structure change may be used: 
        - as client request, e.g. to add or 
          remove some tree element in a server object tree 
        - as message type send by a server to indicate a tree structure change
          to a subscribed client
  -->
  <class type="structurechange_t">
    <list-of type="structure_t"  name="structure"/>
  </class>

  <!-- Value information with time stamp (used in value change notifications) -->
  <class type="value_timed_t">
    <!-- Absolute file path -->
    <item-of type="string"      name="filepath" />
    <!-- Time stamp of value change -->
    <item-of type="time_t"      name="time" />
    <!-- Value -->
    <item-of type="filevalue_u" name="filevalue" />
  </class>

  <!-- Value information without time stamp (used for write requests) -->
  <class type="value_t">
    <!-- Absolute file path -->
    <item-of type="string"      name="filepath" />
    <!-- Value -->
    <item-of type="filevalue_u" name="filevalue" />
  </class>

  <!-- Multiple value change notifications as one message (server to client)  -->
  <class type="notify_t">
    <!-- List of values along with time stamp -->
    <list-of type="value_timed_t"    name="value"/>
  </class>

  <!-- Multiple event notifications as one message (server to client) -->
  <class type="event_t">
    <!-- List of files -->
    <list-of type="data_t"    name="data"/>
  </class>

  <!-- Read request (client to server) -->
  <class type="read_t">
    <!-- Filepath of file to read -->
    <item-of type="string"  name="filepath"/>
  </class>

  <!-- Write request (client to server) -->
  <class type="write_t">
    <!-- Value to set -->
    <item-of type="value_t"  name="value"/>
  </class>


  <!-- Subsciption condition as part of the subscription request -->
  <class type="condition_t">
    <!-- The file the client subscribes for -->
    <item-of type="string"   name="filepath" />
    <!-- The relative value change which has to be exceeded to trigger 
         value change notification (only for single floating point file values) -->
    <item-of type="fp"       name="tolerance"/>
    <!-- Optional list of files for which value change notifications will be 
        sent accompanying the primary notifcation -->
    <list-of type="string"   name="triggerfilepath" />
  </class>

  <!-- Request type to subscribe to some file/folder/event-queue -->
  <class type="subscribe_t">
    <!-- Character string identifier of the subscription -->
    <item-of type="string" name="name" />
    <!-- List of subscription conditions -->
    <list-of type="condition_t" name="condition"/>
  </class>

  <!-- Request type to unsubscribe some file/folder/event-queue -->
  <class type="unsubscribe_t">
    <list-of type="string"   name="filepath" />
  </class>

  
  <!-- Reply message for a confirmed request. Server sends status reply. -->
  <class type="reply_t">
    <!-- Request-id send back in reply -->
    <item-of type="integer"   name="id"/>
    <!-- Status of request as number -->
    <item-of type="integer"   name="status" />
    <!-- Status of request as textual information -->
    <item-of type="string"    name="statusmsg" />
  </class>

  <!-- One entry of a multiple reply -->
  <class type="reply_entry_t">
    <!-- Status of request as number -->
    <item-of type="integer"   name="status" />
    <!-- Status of request as textual information -->
    <item-of type="string"    name="statusmsg" />
  </class>
  
  <!-- Multiple reply message for a confirmed request. 
       Server sends status reply. -->
  <class type="reply_multiple_t">
    <!-- Request-id send back in reply -->
    <item-of type="integer"   name="id"/>
    <!-- Status of request as number -->
    <item-of type="integer"   name="status" />
    <!-- Status of request as textual information -->
    <item-of type="string"    name="statusmsg" />
    <!-- List of request status -->
    <list-of type="reply_entry_t" name = "entry" />
  </class>

  <!-- Request types -->
  <union type="request_u">
    <!-- Read request -->
    <item-of type="read_t"        name="read"/>
    <!-- Write request -->
    <item-of type="write_t"       name="write"/>
    <!-- Subsribe request -->
    <item-of type="subscribe_t"   name="subscribe"/>
    <!-- Unsubsribe request -->
    <item-of type="unsubscribe_t" name="unsubscribe"/>
    <!-- Structure change request -->
    <item-of type="structurechange_t"   name="structurechange"/>
  </union>
 
  <!-- Request message -->
  <class type="request_t">
    <!-- Id to send in reply for a confirmed request -->
    <item-of type="integer" name="id"/>
    <!-- Indicate wether the request shall be confirmed -->
    <item-of type="boolean" name="confirmed"/>
    <!-- Request -->
    <item-of type="request_u" name="u"/>
 </class>

  <!-- Status message -->
  <class type="status_t">
    <!-- server/client online or offline -->
    <item-of type="boolean" name="online"/>
 </class>

  <!-- Message types of UV protocol -->
  <union type="msg_u">
    <!-- Request : client -> server -->
    <item-of type="request_t"  name="request"/>

    <!-- Reply to request : server -> client -->
    <item-of type="reply_t"    name="reply"/>

    <!-- Result of read request : server -> client -->
    <item-of type="result_t"   name="result"/>

    <!-- Value change of subscribed file value : server -> client -->
    <item-of type="notify_t"   name="notify"/>

    <!-- Event of subscribed event queue : server -> client -->
    <item-of type="event_t"    name="event"/>

    <!-- Structure change of subscribed folder : server -> client -->
    <item-of type="structurechange_t"     name="structurechange"/>

    <!-- Status change of peer : server -> client and client -> server -->
    <item-of type="status_t"     name="status"/>

    <!-- Mutiple Reply to multiple request : server -> client -->
    <item-of type="reply_multiple_t"    name="mreply"/>

  </union>

</subclasses>

<!-- Universal value service message object -->
<class type="service_t">
  <item-of type="msg_u" name="msg"/>
</class>

</xfer>


Generated on 4 Mar 2014 for xfergen by  doxygen 1.4.7