1. pragma Ada_2012; 
  2. --  (c) Copyright, Real-Time Innovations, $Date:: 2012-02-16 #$ 
  3. --  All rights reserved. 
  4. -- 
  5. --  No duplications, whole or partial, manual or electronic, may be made 
  6. --  without express written permission.  Any such copies, or 
  7. --  revisions thereof, must display this notice unaltered. 
  8. --  This code contains trade secrets of Real-Time Innovations, Inc. 
  9.  
  10. pragma Ada_2012; 
  11.  
  12. with DDS.DataWriter; 
  13. with DDS.DataWriter_Impl; 
  14. with DDS.Treats_Generic; 
  15. generic 
  16.    with package Treats is new DDS.Treats_Generic (<>); 
  17.    use Treats; 
  18. package DDS.Typed_DataWriter_Generic is 
  19.    pragma Suppress (Elaboration_Check); 
  20.  
  21.    type Ref is new Standard.DDS.DataWriter_Impl.Ref with null record; 
  22.    type Ref_Access is access all Ref'Class; 
  23.  
  24.    function Register_Instance 
  25.      (Self          : not null access Ref; 
  26.       Instance_Data : Data_Type) 
  27.       return Standard.DDS.InstanceHandle_T; 
  28.    --  <dref>FooDataWriter_register_instance</dref> 
  29.  
  30.    function Register_Instance 
  31.      (Self          : not null access Ref; 
  32.       Instance_Data : not null Data_Type_Access) 
  33.       return Standard.DDS.InstanceHandle_T; 
  34.    --  <dref>FooDataWriter_register_instance</dref> 
  35.  
  36.    --  <internal> 
  37.    --  Informs Data Distribution Service that the application will be modifying a 
  38.    --  particular instance. 
  39.    --  This operation is only useful for keyed data types. Using it for non-keyed 
  40.    --  types causes no effect and returns HANDLE_NIL. The operation takes as a parameter 
  41.    --  an instance (of which only the key value is examined) and returns a handle that 
  42.    --  can be used in successive write() or dispose() operations. 
  43.    --  The operation gives Data Distribution Service an opportunity to pre-configure 
  44.    --  itself to improve performance. 
  45.    --  The use of this operation by an application is optional even for keyed types. 
  46.    --  If an instance has not been pre-registered, the application can use the special 
  47.    --  value HANDLE_NIL as the InstanceHandle_t paramater to the write or dispose 
  48.    --  operation and Data Distribution Service will auto-register the instance. 
  49.    --  For best performance, the operation should be invoked prior to calling any 
  50.    --  operation that modifies the instance, such as write, write_w_timestamp, 
  51.    --  dispose and dispose_w_timestamp and the handle used in conjunction with 
  52.    --  the data for those calls. 
  53.    --  When this operation is used, Data Distribution Service will automatically supply 
  54.    --  the value of the source_timestamp that is used. 
  55.    --  This operation may fail and return HANDLE_NIL if ResourceLimitsQosPolicy::max_instances 
  56.    --  limit has been exceeded. 
  57.    --  The operation is idempotent. If it is called for an already registered instance, 
  58.    --  it just returns the already allocated handle. This may be used to lookup and retrieve 
  59.    --  the handle allocated to a given instance. 
  60.    --  This operation can only be called after DataWriter has been enabled. 
  61.    --  Otherwise, HANDLE_NIL will be returned. 
  62.    --  </internal> 
  63.  
  64.    function Register_Instance_W_Timestamp 
  65.      (Self             : not null access Ref; 
  66.       Instance_Data    : Data_Type; 
  67.       Source_Timestamp : in Standard.DDS.Time_T) 
  68.       return Standard.DDS.InstanceHandle_T; 
  69.    --  <dref>FooDataWriter_register_instance_w_timestamp</dref> 
  70.  
  71.    function Register_Instance_W_Timestamp 
  72.      (Self             : not null access Ref; 
  73.       Instance_Data    : Data_Type_Access; 
  74.       Source_Timestamp : in Standard.DDS.Time_T) 
  75.       return Standard.DDS.InstanceHandle_T; 
  76.    --  <dref>FooDataWriter_register_instance_w_timestamp</dref> 
  77.  
  78.    --  <internal> 
  79.    --  Performs the same functions as register_instance except that the application 
  80.    --  provides the value for the source_timestamp. 
  81.    --  The provided source_timestamp potentially affects the relative order in which 
  82.    --  readers observe events from multiple writers. Refer to DESTINATION_ORDER QoS policy for details. 
  83.    --  This operation may fail and return DDS_HANDLE_NIL if ResourceLimitsQosPolicy::max_instances 
  84.    --  limit has been exceeded. 
  85.    --  This operation can only be called after DataWriter has been enabled. 
  86.    --  Otherwise, HANDLE_NIL will be returned. 
  87.    --  </internal> 
  88.  
  89.    function Register_Instance_W_Params 
  90.      (Self             : not null access Ref; 
  91.       Instance_Data    : not null Data_Type_Access; 
  92.       Params           : not null access DDS.WriteParams_T) 
  93.       return Standard.DDS.InstanceHandle_T; 
  94.    --  <dref>FooDataWriter_register_instance_w_params</dref> 
  95.  
  96.    function Register_Instance_W_Params 
  97.      (Self             : not null access Ref; 
  98.       Instance_Data    : Data_Type; 
  99.       Params           : not null access DDS.WriteParams_T) 
  100.       return Standard.DDS.InstanceHandle_T; 
  101.    --  <dref>FooDataWriter_register_instance_w_params</dref> 
  102.  
  103.    --  <internal> 
  104.    --  Performs the same functions as register_instance except that ... 
  105.    --  readers observe events from multiple writers. Refer to DESTINATION_ORDER QoS policy for details. 
  106.    --  This operation may fail and return DDS_HANDLE_NIL if ResourceLimitsQosPolicy::max_instances 
  107.    --  limit has been exceeded. 
  108.    --  This operation can only be called after DataWriter has been enabled. 
  109.    --  Otherwise, HANDLE_NIL will be returned. 
  110.    --  </internal> 
  111.  
  112.    procedure Unregister_Instance 
  113.      (Self          : not null access Ref; 
  114.       Instance_Data : Data_Type; 
  115.       Handle        : in Standard.DDS.InstanceHandle_T); 
  116.    --  <dref>FooDataWriter_unregister_instance</dref> 
  117.  
  118.    procedure Unregister_Instance 
  119.      (Self          : not null access Ref; 
  120.       Instance_Data : not null Data_Type_Access; 
  121.       Handle        : in Standard.DDS.InstanceHandle_T); 
  122.    --  <dref>FooDataWriter_unregister_instance</dref> 
  123.  
  124.    --  <internal> 
  125.    --  Reverses the action of register_instance. 
  126.    --  This operation is useful only for keyed data types. Using it for non-keyed types 
  127.    --  causes no effect and reports no error. The operation takes as a parameter an 
  128.    --  instance (of which only the key value is examined) and a handle. 
  129.    --  This operation should only be called on an instance that is currently registered. 
  130.    --  This includes instances that have been auto-registered by calling operations such 
  131.    --  as write or dispose as described in register_instance. Otherwise, this operation may 
  132.    --  fail with exception BAD_PARAMETER. 
  133.    --  This only need be called just once per instance, regardless of how many times 
  134.    --  register_instance was called for that instance. 
  135.    --  When this operation is used, DDS will automatically supply 
  136.    --  the value of the source_timestamp that is used. 
  137.    --  This operation informs DDS that the DataWriter is no longer 
  138.    --  going to provide any information about the instance. This operation also indicates 
  139.    --  that DDS can locally remove all information regarding that instance. 
  140.    --  The application should not attempt to use the handle previously allocated to 
  141.    --  that instance after calling unregister_instance(). 
  142.    --  The special value HANDLE_NIL can be used for the parameter handle. 
  143.    --  This indicates that the identity of the instance should be automatically deduced 
  144.    --  from the instance_data (by means of the key). 
  145.    --  If handle is any value other than HANDLE_NIL, then it must correspond to an instance 
  146.    --  that has been registered. If there is no correspondence, the operation will fail with 
  147.    --  exception BAD_PARAMETER. 
  148.    --  DDS will not detect the error when the handle is any value other than HANDLE_NIL, 
  149.    --  corresponds to an instance that has been registered, but does not correspond to the 
  150.    --  instance deduced from the instance_data (by means of the key). DDS will treat as if 
  151.    --  the unregister_instance() operation is for the instance as indicated by the handle. 
  152.    --  If after a unregister_instance, the application wants to modify (write or dispose) 
  153.    --  an instance, it has to register it again, or else use the special handle value HANDLE_NIL. 
  154.    --  This operation does not indicate that the instance is deleted 
  155.    --  (that is the purpose of dispose). The operation unregister_instance just indicates 
  156.    --  that the DataWriter no longer has anything to say about the instance. DataReader 
  157.    --  entities that are reading the instance may receive a sample with 
  158.    --  NOT_ALIVE_NO_WRITERS_INSTANCE_STATE for the instance, unless there are other 
  159.    --  DataWriter objects writing that same instance. 
  160.    --  This operation can affect the ownership of the data instance (see OWNERSHIP). 
  161.    --  If the DataWriter was the exclusive owner of the instance, then calling 
  162.    --  unregister_instance() will relinquish that ownership. 
  163.    --  If ReliabilityQosPolicy::kind is set to RELIABLE_RELIABILITY_QOS and the unregistration 
  164.    --  would overflow the resource limits of this writer or of a reader, this operation 
  165.    --  may block for up to ReliabilityQosPolicy::max_blocking_time; if this writer is 
  166.    --  still unable to unregister after that period, this function will fail with exception TIMEOUT. 
  167.    --  </internal> 
  168.  
  169.    procedure Unregister_Instance_W_Timestamp 
  170.      (Self              : not null access Ref; 
  171.       Instance_Data     : Data_Type; 
  172.       Handle            : in Standard.DDS.InstanceHandle_T; 
  173.       Source_Timestamp  : in Standard.DDS.Time_T); 
  174.    --  <dref>FooDataWriter_unregister_instance_w_timestamp</dref> 
  175.  
  176.    procedure Unregister_Instance_W_Timestamp 
  177.      (Self              : not null access Ref; 
  178.       Instance_Data     : Data_Type_Access; 
  179.       Handle            : in Standard.DDS.InstanceHandle_T; 
  180.       Source_Timestamp  : in Standard.DDS.Time_T); 
  181.    --  <dref>FooDataWriter_unregister_instance_w_timestamp</dref> 
  182.  
  183.    --  <internal> 
  184.    --  Performs the same function as unregister_instance except that it also provides 
  185.    --  the value for the source_timestamp. 
  186.    --  The provided source_timestamp potentially affects the relative order in which 
  187.    --  readers observe events from multiple writers. Refer to DESTINATION_ORDER QoS policy for details. 
  188.    --  The constraints on the values of the handle parameter and the corresponding error 
  189.    --  behavior are the same specified for the unregister_instance operation. 
  190.    --  This operation may block and may time out (exception RETCODE_TIMEOUT) under 
  191.    --  the same circumtances described for the unregister_instance operation. 
  192.    --  </internal> 
  193.  
  194.    procedure Unregister_Instance_W_Params 
  195.      (Self              : not null access Ref; 
  196.       Instance_Data     : Data_Type; 
  197.       Params            : access DDS.WriteParams_T); 
  198.    --  <dref>FooDataWriter_unregister_instance_w_params</dref> 
  199.  
  200.    procedure Unregister_Instance_W_Params 
  201.      (Self              : not null access Ref; 
  202.       Instance_Data     : Data_Type_Access; 
  203.       Params            : access DDS.WriteParams_T); 
  204.    --  <dref>FooDataWriter_unregister_instance_w_params</dref> 
  205.  
  206.    procedure Write 
  207.      (Self           : not null access Ref; 
  208.       Instance_Data  : Data_Type; 
  209.       Handle         : in Standard.DDS.InstanceHandle_T_Access); 
  210.    --  <dref>FooDataWriter_write</dref> 
  211.  
  212.    procedure Write 
  213.      (Self           : not null access Ref; 
  214.       Instance_Data  : Data_Type; 
  215.       Handle         : in Standard.DDS.InstanceHandle_T); 
  216.    --  <dref>FooDataWriter_write</dref> 
  217.  
  218.    procedure Write 
  219.      (Self           : not null access Ref; 
  220.       Instance_Data  : not null Data_Type_Access; 
  221.       Handle         : in Standard.DDS.InstanceHandle_T_Access); 
  222.    --  <dref>FooDataWriter_write</dref> 
  223.  
  224.    procedure Write 
  225.      (Self           : not null access Ref; 
  226.       Instance_Data  : not null Data_Type_Access; 
  227.       Handle         : in Standard.DDS.InstanceHandle_T); 
  228.    --  <dref>FooDataWriter_write</dref> 
  229.  
  230.    --  <internal> 
  231.    --  Modifies the value of a data instance. 
  232.    --  When this operation is used, DDS will automatically supply the value of the 
  233.    --  source_timestamp that is made available to DataReader objects by means of the 
  234.    --  source_timestamp attribute inside the SampleInfo. 
  235.    --  (Refer to SampleInfo and DESTINATION_ORDER QoS policy for details). 
  236.    --  As a side effect, this operation asserts liveliness on the DataWriter itself, 
  237.    --  the Publisher and the DomainParticipant. 
  238.    --  Note that the special value HANDLE_NIL can be used for the parameter handle. 
  239.    --  This indicates the identity of the instance should be automatically deduced 
  240.    --  from the instance_data (by means of the key). 
  241.    --  If handle is any value other than HANDLE_NIL, then it must correspond to an instance 
  242.    --  that has been registered. If there is no correspondence, the operation will fail 
  243.    --  with exception BAD_PARAMETER. 
  244.    --  DDS will not detect the error when the handle is any value other than HANDLE_NIL, 
  245.    --  corresponds to an instance that has been registered, but does not correspond 
  246.    --  to the instance deduced from the instance_data (by means of the key). 
  247.    --  DDS will treat as if the write() operation is for the instance as indicated by the handle. 
  248.    --  This operation may block if the RELIABILITY kind is set to RELIABLE_RELIABILITY_QOS 
  249.    --  and the modification would cause data to be lost or else cause one of the limits 
  250.    --  specified in the RESOURCE_LIMITS to be exceeded. 
  251.    --  Specifically, this operation may block in the following situations 
  252.    --  (note that the list may not be exhaustive), 
  253.    --   even if its HistoryQosPolicyKind is KEEP_LAST_HISTORY_QOS: 
  254.    --   * If (ResourceLimitsQosPolicy::max_samples < 
  255.    --            ResourceLimitsQosPolicy::max_instances * HistoryQosPolicy::depth), 
  256.    --     then in the situation where the max_samples resource limit is exhausted, 
  257.    --     DDS is allowed to discard samples of some other instance, as long as at 
  258.    --     least one sample remains for such an instance. If it is still not possible 
  259.    --     to make space available to store the modification, the writer is allowed to block. 
  260.    --   * If (ResourceLimitsQosPolicy::max_samples < ResourceLimitsQosPolicy::max_instances), 
  261.    --     then the DataWriter may block regardless of the HistoryQosPolicy::depth. 
  262.    --  This operation may also block when using BEST_EFFORT_RELIABILITY_QOS and 
  263.    --  ASYNCHRONOUS_PUBLISH_MODE_QOS. In this case, the DataWriter will queue samples 
  264.    --  until they are sent by the asynchronous publishing thread. 
  265.    --  The number of samples that can be stored is determined by the HistoryQosPolicy. 
  266.    --  If the asynchronous thread does not send samples fast enough 
  267.    --  (e.g., when using a slow FlowController), the queue may fill up. In that case, 
  268.    --  subsequent write calls will block. 
  269.    --  If this operation does block for any of the above reasons, the RELIABILITY 
  270.    --  max_blocking_time configures the maximum time the write operation may block 
  271.    --  (waiting for space to become available). If max_blocking_time elapses before 
  272.    --  the DataWriter is able to store the modification without exceeding the limits, 
  273.    --  the operation will time out (exception TIMEOUT). 
  274.    --  If there are no instance resources left, this operation may fail with exception 
  275.    --  OUT_OF_RESOURCES. Calling DataWriter.unregister_instance may help 
  276.    --  freeing up some resources. 
  277.    --  </internal> 
  278.  
  279.  
  280.    procedure Write_W_Timestamp 
  281.      (Self             : not null access Ref; 
  282.       Instance_Data    : Data_Type; 
  283.       Handle           : not null  Standard.DDS.InstanceHandle_T_Access; 
  284.       Source_Timestamp : in Standard.DDS.Time_T); 
  285.    --  <dref>FooDataWriter_write_w_timestamp</dref> 
  286.  
  287.    procedure Write_W_Timestamp 
  288.      (Self             : not null access Ref; 
  289.       Instance_Data    : Data_Type_Access; 
  290.       Handle           : not null  Standard.DDS.InstanceHandle_T_Access; 
  291.       Source_Timestamp : in Standard.DDS.Time_T); 
  292.    --  <dref>FooDataWriter_write_w_timestamp</dref> 
  293.  
  294.    procedure Write_W_Timestamp 
  295.      (Self             : not null access Ref; 
  296.       Instance_Data    : Data_Type; 
  297.       Handle           : in Standard.DDS.InstanceHandle_T; 
  298.       Source_Timestamp : in Standard.DDS.Time_T); 
  299.    --  <dref>FooDataWriter_write_w_timestamp</dref> 
  300.  
  301.    procedure Write_W_Timestamp 
  302.      (Self             : not null access Ref; 
  303.       Instance_Data    : Data_Type_Access; 
  304.       Handle           : in Standard.DDS.InstanceHandle_T; 
  305.       Source_Timestamp : in Standard.DDS.Time_T); 
  306.    --  <dref>FooDataWriter_write_w_timestamp</dref> 
  307.  
  308.    --  <internal> 
  309.    --  Performs the same function as write except that it also provides the value 
  310.    --  for the source_timestamp. 
  311.    --  Explicitly provides the timestamp that will be available to the DataReader objects 
  312.    --  by means of the source_timestamp attribute inside the SampleInfo. 
  313.    --  (Refer to SampleInfo and DESTINATION_ORDER QoS policy for details) 
  314.    --  The constraints on the values of the handle parameter and the corresponding 
  315.    --  error behavior are the same specified for the write operation. 
  316.    --  This operation may block and time out (exception TIMEOUT) 
  317.    --  under the same circumtances described for write. 
  318.    --  If there are no instance resources left, this operation may fail with 
  319.    --  exception OUT_OF_RESOURCES. Calling unregister_instance may help free up some resources. 
  320.    --  This operation may fail with exception BAD_PARAMETER under the same circumstances 
  321.    --  described for the write operation. 
  322.    --  </internal> 
  323.  
  324.  
  325.    procedure Write_W_Params (Self          : not null access Ref; 
  326.                              Instance_Data : Data_Type; 
  327.                              Params        : in out DDS.WriteParams_T); 
  328.    --  <dref>FooDataWriter_write_w_params</dref> 
  329.  
  330.    procedure Write_W_Params (Self          : not null access Ref; 
  331.                              Instance_Data : not null Data_Type_Access; 
  332.                              Params        : in out DDS.WriteParams_T); 
  333.    --  <dref>FooDataWriter_write_w_params</dref> 
  334.  
  335.    --  <internal> 
  336.    --  Performs the same function as write and write_w_timestamp except 
  337.    --  that it also provides the values contained in params. 
  338.    -- 
  339.    --  Allows provision of the instance handle, source timestamp, publication priority, 
  340.    --  and cookie, in params. Allows provision of the sample identity, instance handle, source timestamp, 
  341.    --  The constraints on the values of the handle parameter and the corresponding error 
  342.    --  behavior are the same specified for the write operation. 
  343.    -- 
  344.    --  The cookie is a sequence of bytes tagging the data being written, 
  345.    --  and is used to retrieve the data when it is not available to the writer when needed. 
  346.    -- 
  347.    --  This operation may block and time out (DDS_RETCODE_TIMEOUT) under 
  348.    --  the same circumtances described for write. 
  349.    -- 
  350.    --  If there are no instance resources left, this operation may fail with DDS_RETCODE_OUT_OF_RESOURCES. 
  351.    --  Calling unregister_instance_w_params may help free up some resources. 
  352.    -- 
  353.    --  The handle is either returned by a previous call to DataWriter_register_instance, 
  354.    --  or else the special value DDS_HANDLE_NIL. If Foo has a key and handle is not DDS_HANDLE_NIL, 
  355.    --  handle must represent a registered instance of type Foo. Otherwise, 
  356.    --  this function may fail with DDS_RETCODE_BAD_PARAMETER. 
  357.    --  The source_timestamp value must be greater than or equal to the timestamp 
  358.    --  value used in the last writer operation 
  359.    --  (used in a register, unregister, dispose, or write, with either the 
  360.    --  automatically supplied timestamp or the application provided timestamp). 
  361.    --  This timestamp may potentially affect the order in which readers observe 
  362.    --  events from multiple writers. This timestamp will be available to the 
  363.    --  DDS.DataReader objects by means of the source_timestamp attribute 
  364.    --  inside the DDS.SampleInfo. 
  365.    --  </internal> 
  366.  
  367.  
  368.    procedure Dispose 
  369.      (Self            : not null access Ref; 
  370.       Instance_Data   : Data_Type; 
  371.       Instance_Handle : in Standard.DDS.InstanceHandle_T); 
  372.    --  <dref>FooDataWriter_dispose</dref> 
  373.  
  374.    procedure Dispose 
  375.      (Self            : not null access Ref; 
  376.       Instance_Data   : not null Data_Type_Access; 
  377.       Instance_Handle : in Standard.DDS.InstanceHandle_T); 
  378.    --  <dref>FooDataWriter_dispose</dref> 
  379.  
  380.    --  <internal> 
  381.    --  Requests the middleware to delete the data. 
  382.    --  This operation is useful only for keyed data types. Using it for non-keyed types 
  383.    --  has no effect and reports no error. 
  384.    --  The actual deletion is postponed until there is no more use for that data in the whole system. 
  385.    --  Applications are made aware of the deletion by means of operations on the DataReader 
  386.    --  objects that already knew that instance. DataReader objects that didn't know 
  387.    --  the instance will never see it. 
  388.    --  This operation does not modify the value of the instance. 
  389.    --  The instance_data parameter is passed just for the purposes of identifying the instance. 
  390.    --  When this operation is used, DDS will automatically 
  391.    --  supply the value of the source_timestamp that is made available to DataReader 
  392.    --  objects by means of the source_timestamp attribute inside the SampleInfo. 
  393.    --  The constraints on the values of the handle parameter and the corresponding 
  394.    --  error behavior are the same specified for the DataWriter.unregister_instance operation. 
  395.    --  The special value HANDLE_NIL can be used for the parameter instance_handle. 
  396.    --  This indicates the identity of the instance should be automatically deduced 
  397.    --  from the instance_data (by means of the key). 
  398.    --  If handle is any value other than HANDLE_NIL, then it must correspond to an 
  399.    --  instance that has been registered. If there is no correspondence, the operation 
  400.    --  will fail with exception BAD_PARAMETER. 
  401.    --  DDS will not detect the error when the handle is any 
  402.    --  value other than HANDLE_NIL, corresponds to an instance that has been registered, 
  403.    --  but does not correspond to the instance deduced from the instance_data (by means of the key). 
  404.    --  DDS will treat as if the dispose() operation is for the instance as indicated by the handle. 
  405.    --  This operation may block and time out (exception TIMEOUT) under the same 
  406.    --  circumtances described for write(). 
  407.    --  If there are no instance resources left, this operation may fail with exception OUT_OF_RESOURCES. 
  408.    --  Calling unregister_instance may help freeing up some resources. 
  409.    --  </internal> 
  410.  
  411.    procedure Dispose_W_Timestamp 
  412.      (Self             : not null access Ref; 
  413.       Instance_Data    : Data_Type; 
  414.       Instance_Handle  : in Standard.DDS.InstanceHandle_T; 
  415.       Source_Timestamp : in Standard.DDS.Time_T); 
  416.    --  <dref>FooDataWriter_dispose_w_timestamp</dref> 
  417.  
  418.    procedure Dispose_W_Timestamp 
  419.      (Self             : not null access Ref; 
  420.       Instance_Data    : not null Data_Type_Access; 
  421.       Instance_Handle  : in Standard.DDS.InstanceHandle_T; 
  422.       Source_Timestamp : in Standard.DDS.Time_T); 
  423.    --  <dref>FooDataWriter_dispose_w_timestamp</dref> 
  424.  
  425.    --  <internal> 
  426.    --  Performs the same functions as dispose except that the application provides 
  427.    --  the value for the source_timestamp that is made available to DataReader objects 
  428.    --  by means of the source_timestamp attribute inside the SampleInfo. 
  429.    --  The constraints on the values of the handle parameter and the corresponding 
  430.    --  error behavior are the same specified for the dispose operation. 
  431.    --  This operation may block and time out (exception TIMEOUT) under the same 
  432.    --  circumtances described for write. 
  433.    --  If there are no instance resources left, this operation may fail 
  434.    --  with exception OUT_OF_RESOURCES. 
  435.    --  Calling unregister_instance may help freeing up some resources. 
  436.    --  </internal> 
  437.  
  438.    procedure Dispose_W_Params 
  439.      (Self             : not null access Ref; 
  440.       Instance_Data    : Data_Type; 
  441.       Params           : in DDS.WriteParams_T); 
  442.    --  <dref>FooDataWriter_dispose_w_params</dref> 
  443.  
  444.    procedure Dispose_W_Params 
  445.      (Self             : not null access Ref; 
  446.       Instance_Data    : not null Data_Type_Access; 
  447.       Params           : in DDS.WriteParams_T); 
  448.    --  <dref>FooDataWriter_dispose_w_params</dref> 
  449.  
  450.    procedure Get_Key_Value 
  451.      (Self       : not null access Ref; 
  452.       Key_Holder : out Data_Type; 
  453.       Handle     : in Standard.DDS.InstanceHandle_T); 
  454.    --  <dref>FooDataWriter_get_key_value</dref> 
  455.    --  <internal> 
  456.    --  Retrieve the instance key that corresponds to an instance handle. 
  457.    --  Useful for keyed data types. 
  458.    --  The operation will only fill the fields that form the key inside the key_holder instance. 
  459.    --  If the data has no key, this function has no effect and exit with no error. 
  460.    --  For keyed data types, this operation may fail with exception BAD_PARAMETER 
  461.    --  if the handle does not correspond to an existing data-object known to the DataWriter. 
  462.    --  </internal> 
  463.  
  464.    procedure Get_Key_Value 
  465.      (Self       : not null access Ref; 
  466.       Key_Holder : not null Data_Type_Access; 
  467.       Handle     : in Standard.DDS.InstanceHandle_T); 
  468.    --  <dref>FooDataWriter_get_key_value</dref> 
  469.    --  <internal> 
  470.    --  Retrieve the instance key that corresponds to an instance handle. 
  471.    --  Useful for keyed data types. 
  472.    --  The operation will only fill the fields that form the key inside the key_holder instance. 
  473.    --  If the data has no key, this function has no effect and exit with no error. 
  474.    --  For keyed data types, this operation may fail with exception BAD_PARAMETER 
  475.    --  if the handle does not correspond to an existing data-object known to the DataWriter. 
  476.    --  </internal> 
  477.  
  478.    function Lookup_Instance 
  479.      (Self        : not null access Ref; 
  480.       Key_Holder  : Data_Type) return Standard.DDS.InstanceHandle_T; 
  481.    --  <dref>FooDataWriter_lookup_instance</dref> 
  482.    --  <internal> 
  483.    --  Retrieve the instance handle that corresponds to an instance key_holder. 
  484.    --  Useful for keyed data types. 
  485.    --  This operation takes as a parameter an instance and returns a handle that can be 
  486.    --  used in subsequent operations that accept an instance handle as an argument. 
  487.    --  The instance parameter is only used for the purpose of examining the fields 
  488.    --  that define the key. 
  489.    --  This operation does not register the instance in question. 
  490.    --  If the instance has not been previously registered, or if for any other reason 
  491.    --  DDS is unable to provide an instance handle, DDS will return the special value HANDLE_NIL. 
  492.    --  </internal> 
  493.  
  494.    function Lookup_Instance 
  495.      (Self       : not null access Ref; 
  496.       Key_Holder : not null Data_Type_Access) return Standard.DDS.InstanceHandle_T; 
  497.    --  <dref>FooDataWriter_lookup_instance</dref> 
  498.    --  <internal> 
  499.    --  Retrieve the instance handle that corresponds to an instance key_holder. 
  500.    --  Useful for keyed data types. 
  501.    --  This operation takes as a parameter an instance and returns a handle that can be 
  502.    --  used in subsequent operations that accept an instance handle as an argument. 
  503.    --  The instance parameter is only used for the purpose of examining the fields 
  504.    --  that define the key. 
  505.    --  This operation does not register the instance in question. 
  506.    --  If the instance has not been previously registered, or if for any other reason 
  507.    --  DDS is unable to provide an instance handle, DDS will return the special value HANDLE_NIL. 
  508.    --  </internal> 
  509.  
  510.    function Get_Loan (Self : not null access Ref) return Data_Type_Access; 
  511.    --  <dref>FooDataWriter_get_loan</dref> 
  512.    --  <internal> 
  513.    --  When using SHMEM_REF transfer mode, this operation will return a sample 
  514.    --  access loaned from the DataWriter. By using this loaned sample instead 
  515.    --  of creating new samples through the TypeSupport package, the writer does 
  516.    --  not need to make an additional copy to its output buffers before sending 
  517.    --  it to matching data readers. 
  518.    --  The loan will be returned during the write operation. If a sample has 
  519.    --  been obtained with this operation but will finally not be written, the 
  520.    --  loaned sample must be returned to the DataWriter using Discard_Loan. 
  521.    --  </internal> 
  522.  
  523.    procedure Discard_Loan (Self : not null access Ref; Sample : not null Data_Type_Access); 
  524.    --  <dref>FooDataWriter_discard_loan</dref> 
  525.    --  <internal> 
  526.    --  Discard a loaned sample obtained previously with Get_Loan. This 
  527.    --  operation should only be used if the sample is not going to be written 
  528.    --  with a write operation. Otherwise, the write operation itself will 
  529.    --  return the loan. 
  530.    --  </internal> 
  531.  
  532.    function As_DataWriter (Self : Ref_Access) return Standard.DDS.DataWriter.Ref_Access is 
  533.      (Standard.DDS.DataWriter.Ref_Access (Self)); 
  534.  
  535.    function Narrow 
  536.      (Self        : access DDS.DataWriter.Ref'Class) return not null access Ref is 
  537.      (if Self = null then null else Ref (Self.all)'Access); 
  538.  
  539.    function CreateTypedI return Standard.DDS.DataWriter.Ref_Access; 
  540.  
  541.    procedure DestroyTypedI 
  542.      (Writer : in out Standard.DDS.DataWriter.Ref_Access); 
  543.  
  544. end DDS.Typed_DataWriter_Generic;