-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP support Deadline, Lifespan, Liveliness QoS Policy types and event…
… callbacks in Fast-RTPS 1.8 Signed-off-by: Emerson Knapp <[email protected]>
- Loading branch information
Emerson Knapp
committed
May 2, 2019
1 parent
f870ebe
commit 5e52554
Showing
10 changed files
with
518 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/custom_event_info.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// Copyright 2016-2018 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 RMW_FASTRTPS_SHARED_CPP__CUSTOM_EVENT_INFO_HPP_ | ||
#define RMW_FASTRTPS_SHARED_CPP__CUSTOM_EVENT_INFO_HPP_ | ||
|
||
#include <atomic> | ||
#include <condition_variable> | ||
#include <list> | ||
#include <memory> | ||
#include <mutex> | ||
#include <utility> | ||
|
||
#include "fastcdr/FastBuffer.h" | ||
|
||
#include "fastrtps/subscriber/SampleInfo.h" | ||
#include "fastrtps/subscriber/Subscriber.h" | ||
#include "fastrtps/subscriber/SubscriberListener.h" | ||
#include "fastrtps/participant/Participant.h" | ||
#include "fastrtps/publisher/Publisher.h" | ||
#include "fastrtps/publisher/PublisherListener.h" | ||
|
||
#include "rmw/event.h" | ||
|
||
#include "rmw_fastrtps_shared_cpp/TypeSupport.hpp" | ||
|
||
|
||
class EventListenerInterface | ||
{ | ||
public: | ||
/// Connect a condition variable so a waiter can be notified of new data. | ||
virtual void attachCondition( | ||
std::mutex * conditionMutex, | ||
std::condition_variable * conditionVariable) = 0; | ||
|
||
/// Unset the information from attachCondition. | ||
virtual void detachCondition() = 0; | ||
|
||
/// Check if there is new data available for a specific event type. | ||
/** | ||
* \param event_type The event type to check on. | ||
* \return `true` if new data is available. | ||
*/ | ||
virtual bool hasEvent(rmw_event_type_t event_type) const = 0; | ||
|
||
/// Take ready data for an event type. | ||
/** | ||
* \param event_type The event type to get data for. | ||
* \param event_data A preallocated event information (from rmw/types.h) to fill with data | ||
* \return `true` if data was successfully taken. | ||
* \return `false` if data was not available, in this case nothing was written to event_data. | ||
*/ | ||
virtual bool takeNextEvent(rmw_event_type_t event_type, void * event_data) = 0; | ||
}; | ||
|
||
typedef struct CustomEventInfo | ||
{ | ||
virtual EventListenerInterface * getListener() = 0; | ||
} CustomEventInfo; | ||
|
||
#endif // RMW_FASTRTPS_SHARED_CPP__CUSTOM_EVENT_INFO_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.