SubscriberListener.hpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // Copyright 2019 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 SubscriberListener.hpp
  16. */
  17. #ifndef _FASTDDS_SUBLISTENER_HPP_
  18. #define _FASTDDS_SUBLISTENER_HPP_
  19. #include <fastrtps/fastrtps_dll.h>
  20. #include <fastrtps/qos/DeadlineMissedStatus.h>
  21. #include <fastrtps/qos/LivelinessChangedStatus.h>
  22. #include <fastdds/dds/core/status/SubscriptionMatchedStatus.hpp>
  23. #include <fastdds/dds/subscriber/DataReaderListener.hpp>
  24. namespace eprosima {
  25. namespace fastdds {
  26. namespace dds {
  27. class Subscriber;
  28. /**
  29. * Class SubscriberListener, it should be used by the end user to implement specific callbacks to certain actions.
  30. * It also inherits all DataReaderListener callbacks.
  31. * @ingroup FASTDDS_MODULE
  32. */
  33. class SubscriberListener : public DataReaderListener
  34. {
  35. public:
  36. /**
  37. * @brief Constructor
  38. */
  39. RTPS_DllAPI SubscriberListener()
  40. {
  41. }
  42. /**
  43. * @brief Destructor
  44. */
  45. RTPS_DllAPI virtual ~SubscriberListener()
  46. {
  47. }
  48. /**
  49. * Virtual function to be implemented by the user containing the actions to be performed when a new
  50. * Data Message is available on any reader.
  51. * @param sub Subscriber
  52. */
  53. RTPS_DllAPI virtual void on_data_on_readers(
  54. Subscriber* sub)
  55. {
  56. (void)sub;
  57. }
  58. };
  59. } /* namespace dds */
  60. } /* namespace fastdds */
  61. } /* namespace eprosima */
  62. #endif /* _FASTDDS_SUBLISTENER_HPP_ */