// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /*! * @file SubscriberApp.hpp * This header file contains the declaration of the subscriber functions. * * This file was generated by the tool fastddsgen. */ #ifndef FAST_DDS_GENERATED__SUBSCRIBERAPP_HPP #define FAST_DDS_GENERATED__SUBSCRIBERAPP_HPP #include #include #include #include #include #include "System.hpp" class SubscriberApp : public eprosima::fastdds::dds::DataReaderListener { public: SubscriberApp( const int& domain_id); virtual ~SubscriberApp(); //! Subscription callback void on_data_available( eprosima::fastdds::dds::DataReader* reader) override; //! Subscriber matched method void on_subscription_matched( eprosima::fastdds::dds::DataReader* reader, const eprosima::fastdds::dds::SubscriptionMatchedStatus& info) override; //! Run subscriber void run(); //! Trigger the end of execution void stop(); private: //! Return the current state of execution bool is_stopped(); std::shared_ptr factory_; eprosima::fastdds::dds::DomainParticipant* participant_; eprosima::fastdds::dds::Subscriber* subscriber_; eprosima::fastdds::dds::Topic* bar_topic_; eprosima::fastdds::dds::DataReader* bar_reader_; eprosima::fastdds::dds::TypeSupport bar_type_; eprosima::fastdds::dds::Topic* light_topic_; eprosima::fastdds::dds::DataReader* light_reader_; eprosima::fastdds::dds::TypeSupport light_type_; eprosima::fastdds::dds::Topic* infraredinfo_topic_; eprosima::fastdds::dds::DataReader* infraredinfo_reader_; eprosima::fastdds::dds::TypeSupport infraredinfo_type_; eprosima::fastdds::dds::Topic* infraredcommand_topic_; eprosima::fastdds::dds::DataReader* infraredcommand_reader_; eprosima::fastdds::dds::TypeSupport infraredcommand_type_; eprosima::fastdds::dds::Topic* license_topic_; eprosima::fastdds::dds::DataReader* license_reader_; eprosima::fastdds::dds::TypeSupport license_type_; eprosima::fastdds::dds::Topic* scaleinfo_topic_; eprosima::fastdds::dds::DataReader* scaleinfo_reader_; eprosima::fastdds::dds::TypeSupport scaleinfo_type_; eprosima::fastdds::dds::Topic* weightinfook_topic_; eprosima::fastdds::dds::DataReader* weightinfook_reader_; eprosima::fastdds::dds::TypeSupport weightinfook_type_; eprosima::fastdds::dds::Topic* weightinfoerror_topic_; eprosima::fastdds::dds::DataReader* weightinfoerror_reader_; eprosima::fastdds::dds::TypeSupport weightinfoerror_type_; uint16_t samples_received_; std::atomic stop_; uint32_t period_ms_ = 100; // in ms mutable std::mutex terminate_cv_mtx_; std::condition_variable terminate_cv_; }; #endif // FAST_DDS_GENERATED__SUBSCRIBERAPP_HPP