Skip to content

Commit

Permalink
Refs #14951: Change classes names
Browse files Browse the repository at this point in the history
Signed-off-by: jparisu <javierparis@eprosima.com>
  • Loading branch information
jparisu committed Jul 18, 2022
1 parent ba7228b commit 0be22d2
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ namespace ddsrouter {
namespace core {

CacheChangePool::CacheChangePool(utils::PoolConfiguration configuration)
: utils::LimitlessPool<fastrtps::rtps::CacheChange_t>(configuration)
: utils::UnboundedPool<fastrtps::rtps::CacheChange_t>(configuration)
{
initialize_queue_();
initialize_vector_();
}

bool CacheChangePool::reserve_cache(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include <fastdds/rtps/history/IChangePool.h>

#include <ddsrouter_utils/pool/LimitlessPool.hpp>
#include <ddsrouter_utils/pool/UnboundedPool.hpp>
#include <ddsrouter_utils/pool/IPool.hpp>

namespace eprosima {
Expand All @@ -31,11 +31,11 @@ namespace core {
/**
* @brief This class implements a pool of CacheChange objects specialized as RouterCacheChanges.
*
* It reuses the LimitlessPool implementation, what allow to create a limitless reusable pool.
* It reuses the UnboundedPool implementation, what allow to create a limitless reusable pool.
*
* TODO: implement this class as an IPool (or having an internal pool), without being force to be limitless.
*/
class CacheChangePool : public fastrtps::rtps::IChangePool, public utils::LimitlessPool<fastrtps::rtps::CacheChange_t>
class CacheChangePool : public fastrtps::rtps::IChangePool, public utils::UnboundedPool<fastrtps::rtps::CacheChange_t>
{
public:

Expand All @@ -48,17 +48,17 @@ class CacheChangePool : public fastrtps::rtps::IChangePool, public utils::Limitl
*/
CacheChangePool(utils::PoolConfiguration configuration);

//! Call LimitlessPool::reserve
//! Call UnboundedPool::reserve
virtual bool reserve_cache(
fastrtps::rtps::CacheChange_t*& cache_change) override;

//! Call LimitlessPool::release
//! Call UnboundedPool::release
virtual bool release_cache(
fastrtps::rtps::CacheChange_t* cache_change) override;

protected:

//! Override the LimitlessPool::create_element method to create a RouterCacheChange object.
//! Override the UnboundedPool::create_element method to create a RouterCacheChange object.
virtual fastrtps::rtps::CacheChange_t* new_element_() override;

};
Expand Down
4 changes: 2 additions & 2 deletions ddsrouter_core/src/cpp/writer/implementations/rtps/Writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <efficiency/cache_change/CacheChangePool.hpp>
#include <writer/implementations/rtps/Writer.hpp>
#include <writer/implementations/rtps/filter/RepeaterDataFilter.hpp>
#include <writer/implementations/rtps/filter/OriginDataFilter.hpp>
#include <writer/implementations/rtps/filter/SelfParticipantDataFilter.hpp>
#include <types/dds/RouterCacheChange.hpp>

namespace eprosima {
Expand Down Expand Up @@ -103,7 +103,7 @@ Writer::Writer(
else
{
// Use default filter
data_filter_ = std::make_unique<OriginDataFilter>();
data_filter_ = std::make_unique<SelfParticipantDataFilter>();
}

rtps_writer_->reader_data_filter(data_filter_.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ bool RepeaterDataFilter::is_relevant(
const fastrtps::rtps::CacheChange_t& change,
const fastrtps::rtps::GUID_t& reader_guid) const
{
if (!OriginDataFilter::is_relevant(change, reader_guid))
if (!SelfParticipantDataFilter::is_relevant(change, reader_guid))
{
logDebug(
REPEATER_DATA_FILTER,
"Ignoring message by OriginDataFilter is_relevant result.");
"Ignoring message by SelfParticipantDataFilter is_relevant result.");

// If origin filter does not pass this change, it is discarded
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef __SRC_DDSROUTERCORE_PARTICIPANT_IMPLEMENTATIONS_RTPS_FILTER_REPEATERDATAFILTER_HPP_
#define __SRC_DDSROUTERCORE_PARTICIPANT_IMPLEMENTATIONS_RTPS_FILTER_REPEATERDATAFILTER_HPP_

#include <writer/implementations/rtps/filter/OriginDataFilter.hpp>
#include <writer/implementations/rtps/filter/SelfParticipantDataFilter.hpp>

namespace eprosima {
namespace ddsrouter {
Expand All @@ -34,7 +34,7 @@ namespace rtps {
*
* This uses the RouterCacheChange extra information.
*/
class RepeaterDataFilter : public OriginDataFilter
class RepeaterDataFilter : public SelfParticipantDataFilter
{
public:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@
// limitations under the License.

/**
* @file OriginDataFilter.cpp
* @file SelfParticipantDataFilter.cpp
*/

#include <fastrtps/rtps/common/CacheChange.h>
#include <fastrtps/rtps/common/Guid.h>
#include <ddsrouter_utils/Log.hpp>

#include <types/dds/RouterCacheChange.hpp>
#include <writer/implementations/rtps/filter/OriginDataFilter.hpp>
#include <writer/implementations/rtps/filter/SelfParticipantDataFilter.hpp>

namespace eprosima {
namespace ddsrouter {
namespace core {
namespace rtps {

bool OriginDataFilter::is_relevant(
bool SelfParticipantDataFilter::is_relevant(
const fastrtps::rtps::CacheChange_t& change,
const fastrtps::rtps::GUID_t& reader_guid) const
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
// limitations under the License.

/**
* @file OriginDataFilter.hpp
* @file SelfParticipantDataFilter.hpp
*/

#ifndef __SRC_DDSROUTERCORE_PARTICIPANT_IMPLEMENTATIONS_RTPS_FILTER_ORIGINDATAFILTER_HPP_
#define __SRC_DDSROUTERCORE_PARTICIPANT_IMPLEMENTATIONS_RTPS_FILTER_ORIGINDATAFILTER_HPP_
#ifndef __SRC_DDSROUTERCORE_PARTICIPANT_IMPLEMENTATIONS_RTPS_FILTER_SelfParticipantDataFilter_HPP_
#define __SRC_DDSROUTERCORE_PARTICIPANT_IMPLEMENTATIONS_RTPS_FILTER_SelfParticipantDataFilter_HPP_

#include <fastdds/rtps/interfaces/IReaderDataFilter.hpp>

Expand All @@ -42,7 +42,7 @@ namespace rtps {
/**
* This filter allows to not send messages from this Writer to the Readers in the same Participant.
*/
class OriginDataFilter : public fastdds::rtps::IReaderDataFilter
class SelfParticipantDataFilter : public fastdds::rtps::IReaderDataFilter
{
public:

Expand All @@ -63,5 +63,5 @@ class OriginDataFilter : public fastdds::rtps::IReaderDataFilter
} /* namespace ddsrouter */
} /* namespace eprosima */

#endif /* __SRC_DDSROUTERCORE_PARTICIPANT_IMPLEMENTATIONS_RTPS_FILTER_ORIGINDATAFILTER_HPP_ */
#endif /* __SRC_DDSROUTERCORE_PARTICIPANT_IMPLEMENTATIONS_RTPS_FILTER_SelfParticipantDataFilter_HPP_ */

Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
// limitations under the License.

/**
* @file LimitlessPool.hpp
* @file UnboundedPool.hpp
*/

#ifndef _DDSROUTERUTILS_POOL_LIMITLESSPOOL_HPP_
#define _DDSROUTERUTILS_POOL_LIMITLESSPOOL_HPP_
#ifndef _DDSROUTERUTILS_POOL_UnboundedPool_HPP_
#define _DDSROUTERUTILS_POOL_UnboundedPool_HPP_

#include <vector>

Expand All @@ -44,12 +44,12 @@ namespace utils {
* @tparam T Type of the elements in the pool.
*/
template <typename T>
class LimitlessPool : IPool<T>
class UnboundedPool : IPool<T>
{
public:

/**
* @brief Create a new LimitlessPool object by a Pool Configuration given.
* @brief Create a new UnboundedPool object by a Pool Configuration given.
*
* It initializes the internal vector with the given initial size, using \c new_element_ .
*
Expand All @@ -60,13 +60,13 @@ class LimitlessPool : IPool<T>
*
* @throw InitializationException if the pool configuration is not correct.
*/
LimitlessPool(
UnboundedPool(
PoolConfiguration configuration);

/**
* @brief Destroy the Limitless Pool object and all its reserved elements.
*/
~LimitlessPool();
~UnboundedPool();

/**
* @brief Override IPool::loan
Expand Down Expand Up @@ -126,6 +126,6 @@ class LimitlessPool : IPool<T>
} /* namespace eprosima */

// Include implementation template file
#include <ddsrouter_utils/pool/impl/LimitlessPool.ipp>
#include <ddsrouter_utils/pool/impl/UnboundedPool.ipp>

#endif /* _DDSROUTERUTILS_POOL_LIMITLESSPOOL_HPP_ */
#endif /* _DDSROUTERUTILS_POOL_UnboundedPool_HPP_ */
6 changes: 3 additions & 3 deletions ddsrouter_utils/include/ddsrouter_utils/pool/impl/IPool.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
#ifndef __DDSROUTERUTILS_POOL_IPOOL_IMPL_IPP_
#define __DDSROUTERUTILS_POOL_IPOOL_IMPL_IPP_

#include <ddsrouter_utils/pool/LimitlessPool.hpp>
#include <ddsrouter_utils/pool/UnboundedPool.hpp>

namespace eprosima {
namespace ddsrouter {
namespace utils {

template <typename T>
class LimitlessPool;
class UnboundedPool;

template <typename T>
static IPool<T>* create_pool(
Expand All @@ -35,7 +35,7 @@ static IPool<T>* create_pool(
// Create pool depending on the configuration
// TODO: change it depending on the configuration
// So far only one specialization exists
return new LimitlessPool<T>(configuration);
return new UnboundedPool<T>(configuration);
}

template <typename T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
// limitations under the License.

/**
* @file LimitlessPool.ipp
* @file UnboundedPool.ipp
*/

#ifndef __DDSROUTERUTILS_POOL_LIMITLESSPOOL_IMPL_IPP_
#define __DDSROUTERUTILS_POOL_LIMITLESSPOOL_IMPL_IPP_
#ifndef __DDSROUTERUTILS_POOL_UnboundedPool_IMPL_IPP_
#define __DDSROUTERUTILS_POOL_UnboundedPool_IMPL_IPP_

#include <ddsrouter_utils/Log.hpp>
#include <ddsrouter_utils/utils.hpp>
Expand All @@ -29,7 +29,7 @@ namespace ddsrouter {
namespace utils {

template <typename T>
LimitlessPool<T>::LimitlessPool(
UnboundedPool<T>::UnboundedPool(
PoolConfiguration configuration)
: reserved_(0)
, configuration_(configuration)
Expand All @@ -45,7 +45,7 @@ LimitlessPool<T>::LimitlessPool(
}

template <typename T>
LimitlessPool<T>::~LimitlessPool()
UnboundedPool<T>::~UnboundedPool()
{
// Check that every element has been released
if (elements_.size() != reserved_)
Expand All @@ -63,7 +63,7 @@ LimitlessPool<T>::~LimitlessPool()
}

template <typename T>
bool LimitlessPool<T>::loan(
bool UnboundedPool<T>::loan(
T*& element)
{
if (elements_.size() == 0)
Expand All @@ -81,7 +81,7 @@ bool LimitlessPool<T>::loan(
}

template <typename T>
bool LimitlessPool<T>::return_loan(
bool UnboundedPool<T>::return_loan(
T* element)
{
// This only could happen if more elements are released than reserved.
Expand All @@ -99,7 +99,7 @@ bool LimitlessPool<T>::return_loan(
}

template <typename T>
void LimitlessPool<T>::augment_free_values_()
void UnboundedPool<T>::augment_free_values_()
{
for (unsigned int i = 0; i < this->configuration_.batch_size; ++i)
{
Expand All @@ -110,7 +110,7 @@ void LimitlessPool<T>::augment_free_values_()
}

template <typename T>
void LimitlessPool<T>::initialize_vector_()
void UnboundedPool<T>::initialize_vector_()
{
for (unsigned int i = 0; i < this->configuration_.initial_size; ++i)
{
Expand All @@ -124,4 +124,4 @@ void LimitlessPool<T>::initialize_vector_()
} /* namespace ddsrouter */
} /* namespace eprosima */

#endif /* __DDSROUTERUTILS_POOL_LIMITLESSPOOL_IMPL_IPP_ */
#endif /* __DDSROUTERUTILS_POOL_UnboundedPool_IMPL_IPP_ */

0 comments on commit 0be22d2

Please sign in to comment.