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