Recorder.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 
00009 #ifndef OPENDDS_DCPS_RECORDER_H
00010 #define OPENDDS_DCPS_RECORDER_H
00011 
00012 #include "dds/DCPS/RcObject_T.h"
00013 #include "dds/DCPS/RcHandle_T.h"
00014 #include "dds/DCPS/RawDataSample.h"
00015 
00016 
00017 namespace OpenDDS {
00018 namespace DCPS {
00019 
00020 class Recorder;
00021 
00022 /**
00023  * @class RecorderListener
00024  *
00025  * @brief Listener for handling callbacks from the Recorder
00026  *
00027  * This class is for handling callbacks from the Recorder object.
00028  */
00029 class OpenDDS_Dcps_Export RecorderListener : public RcObject<ACE_SYNCH_MUTEX> {
00030 
00031 public:
00032   virtual ~RecorderListener();
00033   /**
00034    *  Callback for when the Recorder receives a data sample.
00035    *  @param recorder Recorder that received the sample
00036    *  @param sample the received SAMPLE_DATA type sample
00037    *
00038    */
00039   virtual void on_sample_data_received(Recorder*            recorder,
00040                                        const RawDataSample& sample)=0;
00041 
00042   /**
00043    *  Callback for when the Recorder is associated with a DataWriter.
00044    *  @param recorder Recorder that received the association
00045    */
00046   virtual void on_recorder_matched(Recorder*                                recorder,
00047                                    const ::DDS::SubscriptionMatchedStatus & status)=0;
00048 };
00049 
00050 
00051 typedef RcHandle<RecorderListener> RecorderListener_rch;
00052 
00053 typedef Recorder* Recorder_ptr;
00054 typedef TAO_Objref_Var_T<Recorder> Recorder_var;
00055 
00056 class OpenDDS_Dcps_Export Recorder {
00057 public:
00058   typedef Recorder_ptr _ptr_type;
00059   typedef Recorder_var _var_type;
00060 
00061   virtual ~Recorder();
00062 
00063   static Recorder_ptr _duplicate(Recorder_ptr obj);
00064 
00065   virtual void _add_ref() = 0;
00066   virtual void _remove_ref() = 0;
00067 
00068 #if !defined (DDS_HAS_MINIMUM_BIT)
00069   /**
00070    *  Find the bit key for a given repo id.
00071    */
00072   virtual DDS::ReturnCode_t repoid_to_bit_key(const DCPS::RepoId&     id,
00073                                               DDS::BuiltinTopicKey_t& key)=0;
00074 #endif
00075 
00076   /**
00077    * Set the Quality of Service settings for the Recorder.
00078    *
00079    */
00080   virtual DDS::ReturnCode_t set_qos (const ::DDS::SubscriberQos & subscriber_qos,
00081                                      const DDS::DataReaderQos &   datareader_qos)=0;
00082 
00083   /**
00084    * Get the Quality of Service settings for the Recorder.
00085    *
00086    */
00087   virtual DDS::ReturnCode_t get_qos (DDS::SubscriberQos & subscriber_qos,
00088                                      DDS::DataReaderQos & datareader_qos)=0;
00089 
00090   /**
00091    * Change the listener for this Recorder.
00092    *
00093    */
00094   virtual DDS::ReturnCode_t set_listener (const RecorderListener_rch & a_listener,
00095                                           DDS::StatusMask              mask = DEFAULT_STATUS_MASK )=0;
00096 
00097   /**
00098    * Get the listener for this Recorder.
00099    *
00100    */
00101   virtual RecorderListener_rch get_listener() = 0;
00102 };
00103 
00104 }
00105 }
00106 
00107 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00108 
00109 namespace TAO {
00110 
00111 template<>
00112 struct OpenDDS_Dcps_Export Objref_Traits<OpenDDS::DCPS::Recorder> {
00113   static OpenDDS::DCPS::Recorder_ptr duplicate(OpenDDS::DCPS::Recorder_ptr p);
00114   static void release(OpenDDS::DCPS::Recorder_ptr p);
00115   static OpenDDS::DCPS::Recorder_ptr nil();
00116   static CORBA::Boolean marshal(const OpenDDS::DCPS::Recorder_ptr p,
00117                                 TAO_OutputCDR& cdr);
00118 };
00119 
00120 } // namespace TAO
00121 
00122 TAO_END_VERSIONED_NAMESPACE_DECL
00123 
00124 
00125 #endif /* end of include guard: OPENDDS_DCPS_RECORDER_H */

Generated on Fri Feb 12 20:05:25 2016 for OpenDDS by  doxygen 1.4.7