OpenDDS  Snapshot(2023/04/28-20:55)
Replayer.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 
9 #ifndef OPENDDS_DCPS_REPLAYER_H
10 #define OPENDDS_DCPS_REPLAYER_H
11 
12 #include "PoolAllocator.h"
13 #include "RcObject.h"
14 #include "RcHandle_T.h"
15 #include "RawDataSample.h"
16 #include "LocalObject.h"
17 
18 #include <dds/DdsDcpsInfrastructureC.h>
19 
21 
22 namespace OpenDDS {
23 namespace DCPS {
24 
25 class Replayer;
26 
27 /**
28  * @class ReplayerListener
29  *
30  * @brief Listener for handling callbacks from the Replayer
31  *
32  * This class is for handling callbacks from the Replayer object.
33  */
35 public:
37  /**
38  * Callback for when the Replayer is associated with a DataReader.
39  * @param replayer Replayer that received the association
40  */
41  virtual void on_replayer_matched(Replayer* replayer,
42  const DDS::PublicationMatchedStatus & status );
43 };
44 
46 
47 typedef OPENDDS_VECTOR(RawDataSample) RawDataSampleList;
48 
51 
52 /**
53  * @class Replayer
54  *
55  * @brief Send raw data samples in the system
56  *
57  * This class is for sending raw sample data. Combined with data saved from
58  * a recorder, this allows the data to be replayed to DataReaders.
59  */
61  : public virtual LocalObjectBase {
62 public:
63  typedef Replayer_ptr _ptr_type;
64  typedef Replayer_var _var_type;
65 
66  virtual ~Replayer();
67 
68  static Replayer_ptr _duplicate(Replayer_ptr obj);
69 
70  /**
71  * Send the sample to all associated DataReaders.
72  *
73  * @note Only samples of type SAMPLE_DATA should be sent.
74  */
75  virtual DDS::ReturnCode_t write (const RawDataSample& sample) = 0;
76 
77  /**
78  * Send the sample to the specified DataReader.
79  *
80  * @note Only samples of type SAMPLE_DATA should be sent.
81  */
82  virtual DDS::ReturnCode_t write_to_reader (DDS::InstanceHandle_t subscription, // from PublicationMatchedStatus
83  const RawDataSample& sample) = 0;
84 
85  /**
86  * Send the samples to the specified DataReader.
87  *
88  * @note Only samples of type SAMPLE_DATA should be sent.
89  */
90  virtual DDS::ReturnCode_t write_to_reader (DDS::InstanceHandle_t subscription, // from PublicationMatchedStatus
91  const RawDataSampleList& samples ) = 0;
92 
93  /**
94  * Set the Quality of Service settings for the Replayer.
95  */
96  virtual DDS::ReturnCode_t set_qos (const DDS::PublisherQos & publisher_qos,
97  const DDS::DataWriterQos & datawriter_qos) = 0;
98 
99  /**
100  * Get the Quality of Service settings for the Replayer.
101  */
102  virtual DDS::ReturnCode_t get_qos (DDS::PublisherQos & publisher_qos,
103  DDS::DataWriterQos & datawriter_qos) = 0;
104 
105  /**
106  * Change the listener for this Replayer.
107  */
108  virtual DDS::ReturnCode_t set_listener (const ReplayerListener_rch & a_listener,
110 
111  /**
112  * Get the listener for this Replayer.
113  */
114  virtual ReplayerListener_rch get_listener() = 0;
115 };
116 
117 }
118 }
119 
121 
123 
124 namespace TAO {
125 
126 template<>
127 struct OpenDDS_Dcps_Export Objref_Traits<OpenDDS::DCPS::Replayer> {
129  static void release(OpenDDS::DCPS::Replayer_ptr p);
130  static OpenDDS::DCPS::Replayer_ptr nil();
132  TAO_OutputCDR& cdr);
133 };
134 
135 } // namespace TAO
136 
138 
139 
140 #endif /* end of include guard: OPENDDS_DCPS_REPLAYER_H */
Send raw data samples in the system.
Definition: Replayer.h:60
#define TAO_BEGIN_VERSIONED_NAMESPACE_DECL
Replayer * Replayer_ptr
Definition: Replayer.h:49
void release(T x)
#define OpenDDS_Dcps_Export
Definition: dcps_export.h:24
RcHandle< ReplayerListener > ReplayerListener_rch
Definition: Replayer.h:45
T * _duplicate(T *st)
Listener for handling callbacks from the Replayer.
Definition: Replayer.h:34
const DDS::StatusMask DEFAULT_STATUS_MASK
Replayer_var _var_type
Definition: Replayer.h:64
ACE_CDR::Boolean Boolean
HANDLE_TYPE_NATIVE InstanceHandle_t
Definition: DdsDcpsCore.idl:51
unsigned long StatusMask
TAO_AnyTypeCode_Export bool marshal(TAO_OutputCDR &cdr, CORBA::TypeCode_ptr tc, CORBA::ULong offset)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
TAO_Objref_Var_T< Replayer > Replayer_var
Definition: Replayer.h:50
::DDS::ReturnCode_t write(in<%SCOPED%> instance_data, in ::DDS::InstanceHandle_t handle)
typedef OPENDDS_VECTOR(ActionConnectionRecord) ConnectionRecords
#define TAO_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
Replayer_ptr _ptr_type
Definition: Replayer.h:63