PublicationInstance.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 #ifndef OPENDDS_DCPS_PUBLICATION_INSTANCE_H
00009 #define OPENDDS_DCPS_PUBLICATION_INSTANCE_H
00010 
00011 #include "dcps_export.h"
00012 #include "InstanceDataSampleList.h"
00013 #include "DataSampleElement.h"
00014 #include "dds/DCPS/PoolAllocationBase.h"
00015 
00016 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00017 #pragma once
00018 #endif /* ACE_LACKS_PRAGMA_ONCE */
00019 
00020 namespace OpenDDS {
00021 namespace DCPS {
00022 
00023 
00024 /**
00025   * @class PublicationInstance
00026   *
00027   * @brief Struct that has information about an instance and the instance
00028   *        sample list.
00029   * @note  This struct retains the ownership of the registered sample data
00030   *        from typed datawriter. The data will be duplicated for the register,
00031   *        unregister and dispose control message.
00032   */
00033 struct OpenDDS_Dcps_Export PublicationInstance : public PoolAllocationBase {
00034 
00035   PublicationInstance(DataSample* registered_sample)
00036     : sequence_(),
00037       group_id_(0),
00038       registered_sample_(registered_sample),
00039       unregistered_(false),
00040       instance_handle_(0),
00041       deadline_timer_id_(-1) {
00042   }
00043 
00044   ~PublicationInstance() {
00045     // Release will decrement the reference count and
00046     // the sample data is released when the reference
00047     // count is 0.
00048     registered_sample_->release();
00049   }
00050 
00051   /// The sequence number.
00052   SequenceNumber   sequence_ ;
00053 
00054   /// The group id. // NOT USED IN FIRST IMPL
00055   CoherencyGroup   group_id_ ;
00056 
00057   /// The sample data for registration.
00058   DataSample*      registered_sample_;
00059 
00060   /// History of the instance samples.
00061   InstanceDataSampleList   samples_;
00062 
00063   /// The flag to indicate whether the instance is unregistered.
00064   bool             unregistered_;
00065 
00066   /// The instance handle for the registered object
00067   DDS::InstanceHandle_t instance_handle_;
00068 
00069   ACE_Time_Value   last_sample_tv_;
00070 
00071   ACE_Time_Value   cur_sample_tv_;
00072 
00073   long             deadline_timer_id_;
00074 };
00075 
00076 } // namespace DCPS
00077 } // namespace OpenDDS
00078 
00079 #endif /* OPENDDS_DCPS_PUBLICATION_INSTANCE_H */

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