SampleInfo.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. /**
  15. * @file SampleInfo.h
  16. */
  17. #ifndef SAMPLEINFO_H_
  18. #define SAMPLEINFO_H_
  19. #include <cstdint>
  20. #include <fastrtps/fastrtps_dll.h>
  21. #include <fastdds/rtps/common/Time_t.h>
  22. #include <fastdds/rtps/common/InstanceHandle.h>
  23. #include <fastdds/rtps/common/CacheChange.h>
  24. namespace eprosima {
  25. namespace fastrtps {
  26. /**
  27. * Class SampleInfo_t with information that is provided along a sample when reading data from a Subscriber.
  28. * @ingroup FASTRTPS_MODULE
  29. */
  30. class RTPS_DllAPI SampleInfo_t
  31. {
  32. public:
  33. SampleInfo_t()
  34. : sampleKind(rtps::ALIVE)
  35. , ownershipStrength(0)
  36. , sample_identity(rtps::SampleIdentity::unknown())
  37. , related_sample_identity(rtps::SampleIdentity::unknown())
  38. {
  39. }
  40. virtual ~SampleInfo_t()
  41. {
  42. }
  43. //!Sample kind.
  44. rtps::ChangeKind_t sampleKind;
  45. //!Ownership Strength of the writer of the sample (0 if the ownership kind is set to SHARED_OWNERSHIP_QOS).
  46. uint32_t ownershipStrength;
  47. //!Source timestamp of the sample.
  48. rtps::Time_t sourceTimestamp;
  49. //!Reception timestamp of the sample.
  50. rtps::Time_t receptionTimestamp;
  51. //!InstanceHandle of the data
  52. rtps::InstanceHandle_t iHandle;
  53. rtps::SampleIdentity sample_identity;
  54. rtps::SampleIdentity related_sample_identity;
  55. };
  56. } /* namespace fastrtps */
  57. } /* namespace eprosima */
  58. #endif /* SAMPLEINFO_H_ */