00001 /* 00002 * 00003 * 00004 * Distributed under the OpenDDS License. 00005 * See: http://www.opendds.org/license.html 00006 */ 00007 00008 00009 #ifndef OPENDDS_DCPS_REPLAYER_H 00010 #define OPENDDS_DCPS_REPLAYER_H 00011 00012 #include "dds/DCPS/PoolAllocator.h" 00013 #include "dds/DCPS/RcObject.h" 00014 #include "dds/DCPS/RcHandle_T.h" 00015 #include "dds/DCPS/RawDataSample.h" 00016 #include "dds/DdsDcpsInfrastructureC.h" 00017 00018 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 00019 00020 namespace OpenDDS { 00021 namespace DCPS { 00022 00023 class Replayer; 00024 00025 /** 00026 * @class ReplayerListener 00027 * 00028 * @brief Listener for handling callbacks from the Replayer 00029 * 00030 * This class is for handling callbacks from the Replayer object. 00031 */ 00032 class OpenDDS_Dcps_Export ReplayerListener : public RcObject { 00033 public: 00034 ~ReplayerListener(); 00035 /** 00036 * Callback for when the Replayer is associated with a DataReader. 00037 * @param replayer Replayer that received the association 00038 */ 00039 virtual void on_replayer_matched(Replayer* replayer, 00040 const DDS::PublicationMatchedStatus & status ); 00041 }; 00042 00043 typedef RcHandle<ReplayerListener> ReplayerListener_rch; 00044 00045 typedef OPENDDS_VECTOR(RawDataSample) RawDataSampleList; 00046 00047 typedef Replayer* Replayer_ptr; 00048 typedef TAO_Objref_Var_T<Replayer> Replayer_var; 00049 00050 /** 00051 * @class Replayer 00052 * 00053 * @brief Send raw data samples in the system 00054 * 00055 * This class is for sending raw sample data. Combined with data saved from 00056 * a recorder, this allows the data to be replayed to DataReaders. 00057 */ 00058 class OpenDDS_Dcps_Export Replayer 00059 : public virtual RcObject { 00060 public: 00061 typedef Replayer_ptr _ptr_type; 00062 typedef Replayer_var _var_type; 00063 00064 virtual ~Replayer(); 00065 00066 static Replayer_ptr _duplicate(Replayer_ptr obj); 00067 00068 /** 00069 * Send the sample to all associated DataReaders. 00070 * 00071 * @note Only samples of type SAMPLE_DATA should be sent. 00072 */ 00073 virtual DDS::ReturnCode_t write (const RawDataSample& sample )=0; 00074 00075 /** 00076 * Send the sample to the specified DataReader. 00077 * 00078 * @note Only samples of type SAMPLE_DATA should be sent. 00079 */ 00080 virtual DDS::ReturnCode_t write_to_reader (DDS::InstanceHandle_t subscription, // from PublicationMatchedStatus 00081 const RawDataSample& sample )=0; 00082 00083 /** 00084 * Send the samples to the specified DataReader. 00085 * 00086 * @note Only samples of type SAMPLE_DATA should be sent. 00087 */ 00088 virtual DDS::ReturnCode_t write_to_reader (DDS::InstanceHandle_t subscription, // from PublicationMatchedStatus 00089 const RawDataSampleList& samples )=0; 00090 00091 /** 00092 * Set the Quality of Service settings for the Replayer. 00093 * 00094 */ 00095 virtual DDS::ReturnCode_t set_qos (const DDS::PublisherQos & publisher_qos, 00096 const DDS::DataWriterQos & datawriter_qos)=0; 00097 00098 /** 00099 * Get the Quality of Service settings for the Replayer. 00100 * 00101 */ 00102 virtual DDS::ReturnCode_t get_qos (DDS::PublisherQos & publisher_qos, 00103 DDS::DataWriterQos & datawriter_qos)=0; 00104 00105 /** 00106 * Change the listener for this Replayer. 00107 * 00108 */ 00109 virtual DDS::ReturnCode_t set_listener (const ReplayerListener_rch & a_listener, 00110 DDS::StatusMask mask = DEFAULT_STATUS_MASK)=0; 00111 00112 /** 00113 * Get the listener for this Replayer. 00114 * 00115 */ 00116 virtual ReplayerListener_rch get_listener() = 0; 00117 }; 00118 00119 } 00120 } 00121 00122 OPENDDS_END_VERSIONED_NAMESPACE_DECL 00123 00124 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00125 00126 namespace TAO { 00127 00128 template<> 00129 struct OpenDDS_Dcps_Export Objref_Traits<OpenDDS::DCPS::Replayer> { 00130 static OpenDDS::DCPS::Replayer_ptr duplicate(OpenDDS::DCPS::Replayer_ptr p); 00131 static void release(OpenDDS::DCPS::Replayer_ptr p); 00132 static OpenDDS::DCPS::Replayer_ptr nil(); 00133 static CORBA::Boolean marshal(const OpenDDS::DCPS::Replayer_ptr p, 00134 TAO_OutputCDR& cdr); 00135 }; 00136 00137 } // namespace TAO 00138 00139 TAO_END_VERSIONED_NAMESPACE_DECL 00140 00141 00142 #endif /* end of include guard: OPENDDS_DCPS_REPLAYER_H */