Skip to content

Commit

Permalink
Apply Miguel's suggestions: make LocalReaderPointer inherit RefCounte…
Browse files Browse the repository at this point in the history
…rPointer<> and add DOXYGEN_SHOULD_SKIP_THIS_PUBLIC

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
  • Loading branch information
Mario-DL committed Nov 15, 2024
1 parent 8560483 commit e837ad7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
9 changes: 8 additions & 1 deletion include/fastdds/rtps/reader/LocalReaderPointer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#ifndef FASTDDS_RTPS_READER__LOCALREADERPOINTER_HPP
#define FASTDDS_RTPS_READER__LOCALREADERPOINTER_HPP

#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC

#include <fastrtps/utils/RefCountedPointer.hpp>

namespace eprosima {
Expand All @@ -28,10 +30,15 @@ namespace rtps {

class RTPSReader;

using LocalReaderPointer = RefCountedPointer<RTPSReader>;
struct LocalReaderPointer : public RefCountedPointer<RTPSReader>
{

};

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

#endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC

#endif // FASTDDS_RTPS_READER__LOCALREADERPOINTER_HPP
18 changes: 9 additions & 9 deletions include/fastdds/rtps/reader/RTPSReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <fastdds/rtps/Endpoint.h>
#include <fastdds/rtps/history/ReaderHistory.h>
#include <fastdds/rtps/interfaces/IReaderDataFilter.hpp>
#include <fastdds/rtps/reader/LocalReaderPointer.hpp>
#include <fastdds/statistics/rtps/monitor_service/connections_fwd.hpp>
#include <fastdds/statistics/rtps/StatisticsCommon.hpp>
#include <fastrtps/qos/LivelinessChangedStatus.h>
Expand All @@ -47,6 +46,7 @@ struct CacheChange_t;
struct ReaderHistoryState;
class WriterProxyData;
class IDataSharingListener;
struct LocalReaderPointer;

/**
* Class RTPSReader, manages the reception of data from its matched writers.
Expand Down Expand Up @@ -208,14 +208,6 @@ class RTPSReader
RTPS_DllAPI bool setListener(
ReaderListener* target);

/**
* @brief Retrieves the local pointer to this reader
* to be used by other local entities.
*
* @return Local pointer to this reader.
*/
RTPS_DllAPI std::shared_ptr<LocalReaderPointer> get_local_pointer();

/**
* Reserve a CacheChange_t.
* @param change Pointer to pointer to the Cache.
Expand Down Expand Up @@ -499,6 +491,14 @@ class RTPSReader
bool is_datasharing_compatible_with(
const WriterProxyData& wdata);

/**
* @brief Retrieves the local pointer to this reader
* to be used by other local entities.
*
* @return Local pointer to this reader.
*/
std::shared_ptr<LocalReaderPointer> get_local_pointer();

//!ReaderHistory
ReaderHistory* mp_history;
//!Listener
Expand Down
4 changes: 4 additions & 0 deletions include/fastrtps/utils/RefCountedPointer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#ifndef UTILS__REFCOUNTEDPOINTER_HPP
#define UTILS__REFCOUNTEDPOINTER_HPP

#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC

#include <atomic>
#include <cassert>
#include <condition_variable>
Expand Down Expand Up @@ -215,4 +217,6 @@ class RefCountedPointer
} // namespace fastdds
} // namespace eprosima

#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC

#endif // UTILS__REFCOUNTEDPOINTER_HPP
2 changes: 1 addition & 1 deletion src/cpp/rtps/participant/RTPSParticipantImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#include <fastdds/rtps/history/IChangePool.h>
#include <fastdds/rtps/history/IPayloadPool.h>
#include <fastdds/rtps/messages/MessageReceiver.h>
#include <fastdds/rtps/reader/LocalReaderPointer.hpp>
#include <fastdds/rtps/resources/ResourceEvent.h>
#include <fastdds/rtps/transport/SenderResource.h>
#include <fastrtps/utils/Semaphore.h>
Expand Down Expand Up @@ -122,6 +121,7 @@ class PDP;
class PDPSimple;
class IPersistenceService;
class WLP;
struct LocalReaderPointer;

/**
* @brief Class RTPSParticipantImpl, it contains the private implementation of the RTPSParticipant functions and
Expand Down

0 comments on commit e837ad7

Please sign in to comment.