Program Listing for File RTPSDomain.hpp

Return to documentation for file (include/fastdds/rtps/RTPSDomain.hpp)

// 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.

#ifndef FASTDDS_RTPS__RTPSDOMAIN_HPP
#define FASTDDS_RTPS__RTPSDOMAIN_HPP

#include <atomic>
#include <mutex>
#include <set>

#include <fastdds/LibrarySettings.hpp>
#include <fastdds/rtps/attributes/RTPSParticipantAttributes.hpp>
#include <fastdds/rtps/attributes/ThreadSettings.hpp>
#include <fastdds/rtps/common/Types.hpp>
#include <fastdds/rtps/history/IPayloadPool.hpp>
#include <fastdds/rtps/history/IChangePool.hpp>

namespace eprosima {
namespace fastdds {
namespace rtps {

class RTPSParticipantImpl;
class RTPSParticipant;
class RTPSParticipantListener;
class RTPSWriter;
class WriterAttributes;
class WriterHistory;
class WriterListener;
class RTPSReader;
class ReaderAttributes;
class ReaderHistory;
class ReaderListener;
class RTPSDomainImpl;

class RTPSDomain
{
public:

    FASTDDS_EXPORTED_API static void set_filewatch_thread_config(
            const fastdds::rtps::ThreadSettings& watch_thread,
            const fastdds::rtps::ThreadSettings& callback_thread);

    FASTDDS_EXPORTED_API static void stopAll();

    FASTDDS_EXPORTED_API static RTPSParticipant* createParticipant(
            uint32_t domain_id,
            const RTPSParticipantAttributes& attrs,
            RTPSParticipantListener* plisten = nullptr);

    FASTDDS_EXPORTED_API static RTPSParticipant* createParticipant(
            uint32_t domain_id,
            bool enabled,
            const RTPSParticipantAttributes& attrs,
            RTPSParticipantListener* plisten = nullptr);

    static RTPSParticipant* create_client_server_participant(
            uint32_t domain_id,
            bool enabled,
            const RTPSParticipantAttributes& attrs,
            RTPSParticipantListener* plisten = nullptr);

    FASTDDS_EXPORTED_API static RTPSWriter* createRTPSWriter(
            RTPSParticipant* p,
            WriterAttributes& watt,
            WriterHistory* hist,
            WriterListener* listen = nullptr);

    FASTDDS_EXPORTED_API static RTPSWriter* createRTPSWriter(
            RTPSParticipant* p,
            const EntityId_t& entity_id,
            WriterAttributes& watt,
            WriterHistory* hist,
            WriterListener* listen = nullptr);

    FASTDDS_EXPORTED_API static bool removeRTPSWriter(
            RTPSWriter* writer);

    FASTDDS_EXPORTED_API static RTPSReader* createRTPSReader(
            RTPSParticipant* p,
            ReaderAttributes& ratt,
            ReaderHistory* hist,
            ReaderListener* listen = nullptr);

    FASTDDS_EXPORTED_API static RTPSReader* createRTPSReader(
            RTPSParticipant* p,
            ReaderAttributes& ratt,
            const std::shared_ptr<IPayloadPool>& payload_pool,
            ReaderHistory* hist,
            ReaderListener* listen = nullptr);

    FASTDDS_EXPORTED_API static RTPSReader* createRTPSReader(
            RTPSParticipant* p,
            const EntityId_t& entity_id,
            ReaderAttributes& ratt,
            const std::shared_ptr<IPayloadPool>& payload_pool,
            ReaderHistory* hist,
            ReaderListener* listen = nullptr);

    FASTDDS_EXPORTED_API static bool removeRTPSReader(
            RTPSReader* reader);

    FASTDDS_EXPORTED_API static bool removeRTPSParticipant(
            RTPSParticipant* p);

    FASTDDS_EXPORTED_API static bool get_library_settings(
            fastdds::LibrarySettings& library_settings);

    FASTDDS_EXPORTED_API static bool set_library_settings(
            const fastdds::LibrarySettings& library_settings);

private:

    RTPSDomain() = delete;

    ~RTPSDomain() = delete;
};

} // namespace rtps
} // namespace fastdds
} // namespace eprosima

#endif // FASTDDS_RTPS__RTPSDOMAIN_HPP