PersistentWriter.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 PersistentWriter.h
  16. */
  17. #ifndef _FASTDDS_RTPS_PERSISTENTWRITER_H_
  18. #define _FASTDDS_RTPS_PERSISTENTWRITER_H_
  19. #include <fastdds/rtps/writer/RTPSWriter.h>
  20. #include <string>
  21. #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
  22. namespace eprosima {
  23. namespace fastrtps{
  24. namespace rtps {
  25. class IPersistenceService;
  26. class WriterHistory;
  27. /**
  28. * Class PersistentWriter, that manages history persistence.
  29. * @ingroup WRITER_MODULE
  30. */
  31. class PersistentWriter
  32. {
  33. protected:
  34. PersistentWriter(GUID_t& guid,WriterAttributes& att,WriterHistory* hist, IPersistenceService* persistence);
  35. public:
  36. virtual ~PersistentWriter();
  37. /**
  38. * Add a specific change to storage.
  39. * @param change Pointer to the change to be stored.
  40. */
  41. void add_persistent_change(CacheChange_t* change);
  42. /**
  43. * Remove a change from storage.
  44. * @param change Pointer to the change to be removed.
  45. */
  46. void remove_persistent_change(CacheChange_t* change);
  47. private:
  48. //!Persistence service
  49. IPersistenceService* persistence_;
  50. //!Persistence GUID
  51. std::string persistence_guid_;
  52. };
  53. }
  54. } /* namespace rtps */
  55. } /* namespace eprosima */
  56. #endif
  57. #endif /* _FASTDDS_RTPS_PERSISTENTWRITER_H_ */