StatelessPersistentWriter.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Copyright 2018 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 StatelessPersistentWriter.h
  16. */
  17. #ifndef _FASTDDS_RTPS_STATELESSPERSISTENTWRITER_H_
  18. #define _FASTDDS_RTPS_STATELESSPERSISTENTWRITER_H_
  19. #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
  20. #include <fastdds/rtps/writer/StatelessWriter.h>
  21. #include <fastdds/rtps/writer/PersistentWriter.h>
  22. namespace eprosima {
  23. namespace fastrtps{
  24. namespace rtps {
  25. class IPersistenceService;
  26. /**
  27. * Class StatelessPersistentWriter, specialization of StatelessWriter that manages history persistence.
  28. * @ingroup WRITER_MODULE
  29. */
  30. class StatelessPersistentWriter : public StatelessWriter, private PersistentWriter
  31. {
  32. friend class RTPSParticipantImpl;
  33. StatelessPersistentWriter(RTPSParticipantImpl*,GUID_t& guid,WriterAttributes& att,WriterHistory* hist,WriterListener* listen=nullptr, IPersistenceService* persistence = nullptr);
  34. public:
  35. virtual ~StatelessPersistentWriter();
  36. /**
  37. * Add a specific change to all ReaderLocators.
  38. * @param p Pointer to the change.
  39. * @param max_blocking_time
  40. */
  41. void unsent_change_added_to_history(
  42. CacheChange_t* p,
  43. const std::chrono::time_point<std::chrono::steady_clock>& max_blocking_time) override;
  44. /**
  45. * Indicate the writer that a change has been removed by the history due to some HistoryQos requirement.
  46. * @param a_change Pointer to the change that is going to be removed.
  47. * @return True if removed correctly.
  48. */
  49. bool change_removed_by_history(CacheChange_t* a_change) override;
  50. };
  51. }
  52. } /* namespace rtps */
  53. } /* namespace eprosima */
  54. #endif
  55. #endif /* _FASTDDS_RTPS_STATELESSPERSISTENTWRITER_H_ */