OpenDDS  Snapshot(2023/04/28-20:55)
Recorder.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_RECORDER_H
10 #define OPENDDS_DCPS_RECORDER_H
11 
12 #include "LocalObject.h"
13 #include "PoolAllocator.h"
14 #include "RawDataSample.h"
15 #include "RcHandle_T.h"
16 
17 #include <dds/DdsDcpsInfrastructureC.h>
18 
19 #include <dds/DdsDynamicDataC.h>
20 
22 
23 namespace OpenDDS {
24 namespace DCPS {
25 
26 class Recorder;
27 
28 /**
29  * @class RecorderListener
30  *
31  * @brief Listener for handling callbacks from the Recorder
32  *
33  * This class is for handling callbacks from the Recorder object.
34  */
36 
37 public:
38  virtual ~RecorderListener();
39  /**
40  * Callback for when the Recorder receives a data sample.
41  * @param recorder Recorder that received the sample
42  * @param sample the received SAMPLE_DATA type sample
43  *
44  */
45  virtual void on_sample_data_received(Recorder* recorder,
46  const RawDataSample& sample) = 0;
47 
48  /**
49  * Callback for when the Recorder is associated with a DataWriter.
50  * @param recorder Recorder that received the association
51  */
52  virtual void on_recorder_matched(Recorder* recorder,
53  const DDS::SubscriptionMatchedStatus & status) = 0;
54 };
55 
57 
60 
62  : public virtual LocalObjectBase {
63 public:
64  typedef Recorder_ptr _ptr_type;
65  typedef Recorder_var _var_type;
66 
67  virtual ~Recorder();
68 
69  static Recorder_ptr _duplicate(Recorder_ptr obj);
70 
71 #if !defined (DDS_HAS_MINIMUM_BIT)
72  /**
73  * Find the bit key for a given repo id.
74  */
75  virtual DDS::ReturnCode_t repoid_to_bit_key(const DCPS::GUID_t& id,
77 #endif
78 
79  /**
80  * Set the Quality of Service settings for the Recorder.
81  *
82  */
83  virtual DDS::ReturnCode_t set_qos (const DDS::SubscriberQos & subscriber_qos,
84  const DDS::DataReaderQos & datareader_qos)=0;
85 
86  /**
87  * Get the Quality of Service settings for the Recorder.
88  *
89  */
90  virtual DDS::ReturnCode_t get_qos (DDS::SubscriberQos & subscriber_qos,
91  DDS::DataReaderQos & datareader_qos)=0;
92 
93  /**
94  * Change the listener for this Recorder.
95  *
96  */
97  virtual DDS::ReturnCode_t set_listener (const RecorderListener_rch & a_listener,
99 
100  /**
101  * Get the listener for this Recorder.
102  *
103  */
104  virtual RecorderListener_rch get_listener() = 0;
105 
106 #ifndef OPENDDS_SAFETY_PROFILE
107  virtual DDS::DynamicData_ptr get_dynamic_data(const RawDataSample& sample) = 0;
108 #endif
109 
110  virtual void check_encap(bool b) = 0;
111  virtual bool check_encap() const = 0;
112 };
113 
114 }
115 }
116 
118 
120 
121 namespace TAO {
122 
123 template<>
126  static void release(::OpenDDS::DCPS::Recorder_ptr p);
129 };
130 
131 } // namespace TAO
132 
134 
135 
136 #endif /* end of include guard: OPENDDS_DCPS_RECORDER_H */
#define TAO_BEGIN_VERSIONED_NAMESPACE_DECL
void release(T x)
Recorder_var _var_type
Definition: Recorder.h:65
Recorder * Recorder_ptr
Definition: Recorder.h:58
#define OpenDDS_Dcps_Export
Definition: dcps_export.h:24
sequence< octet > key
TAO_Objref_Var_T< Recorder > Recorder_var
Definition: Recorder.h:59
Listener for handling callbacks from the Recorder.
Definition: Recorder.h:35
T * _duplicate(T *st)
const DDS::StatusMask DEFAULT_STATUS_MASK
Recorder_ptr _ptr_type
Definition: Recorder.h:64
unsigned long StatusMask
RcHandle< RecorderListener > RecorderListener_rch
Definition: Recorder.h:56
TAO_AnyTypeCode_Export bool marshal(TAO_OutputCDR &cdr, CORBA::TypeCode_ptr tc, CORBA::ULong offset)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
#define TAO_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28