Skip to content

Commit

Permalink
Avoid problems with template method inlining. (#1009)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelCompany authored Feb 13, 2020
1 parent d1d7605 commit 34c81e6
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 8 deletions.
32 changes: 30 additions & 2 deletions include/fastrtps/rtps/builtin/discovery/endpoint/EDPSimple.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,36 @@ class EDPSimple : public EDP
*/
virtual bool createSEDPEndpoints();

/**
* Create a cache change on a builtin writer and serialize a WriterProxyData on it.
* @param [in] data The WriterProxyData object to be serialized.
* @param [in] writer The writer,history pair where the change should be added.
* @param [in] remove_same_instance Should previous changes with same key be removed?
* @param [out] created_change Where the pointer to the created change should be returned.
* @return false if data could not be serialized into the created change.
*/
bool serialize_writer_proxy_data(
const WriterProxyData& data,
const t_p_StatefulWriter& writer,
bool remove_same_instance,
CacheChange_t** created_change);

/**
* Create a cache change on a builtin writer and serialize a ReaderProxyData on it.
* @param [in] data The ReaderProxyData object to be serialized.
* @param [in] writer The writer,history pair where the change should be added.
* @param [in] remove_same_instance Should previous changes with same key be removed?
* @param [out] created_change Where the pointer to the created change should be returned.
* @return false if data could not be serialized into the created change.
*/
bool serialize_reader_proxy_data(
const ReaderProxyData& data,
const t_p_StatefulWriter& writer,
bool remove_same_instance,
CacheChange_t** created_change);

private:

/**
* Create a cache change on a builtin writer and serialize a ProxyData on it.
* @param [in] data The ProxyData object to be serialized.
Expand All @@ -201,8 +231,6 @@ class EDPSimple : public EDP
bool remove_same_instance,
CacheChange_t** created_change);

private:

#if HAVE_SECURITY
bool create_sedp_secure_endpoints();

Expand Down
4 changes: 2 additions & 2 deletions src/cpp/rtps/builtin/discovery/endpoint/EDPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ bool EDPClient::processLocalReaderProxyData(
#endif

CacheChange_t* change = nullptr;
bool ret_val = serialize_proxy_data(*rdata, *writer, true, &change);
bool ret_val = serialize_reader_proxy_data(*rdata, *writer, true, &change);
if (change != nullptr)
{
// We must key-signed the CacheChange_t to avoid duplications:
Expand Down Expand Up @@ -84,7 +84,7 @@ bool EDPClient::processLocalWriterProxyData(
#endif

CacheChange_t* change = nullptr;
bool ret_val = serialize_proxy_data(*wdata, *writer, true, &change);
bool ret_val = serialize_writer_proxy_data(*wdata, *writer, true, &change);
if (change != nullptr)
{
// We must key-signed the CacheChange_t to avoid duplications:
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/rtps/builtin/discovery/endpoint/EDPServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ bool EDPServer::processLocalWriterProxyData(

// unlike on EDPSimple we wouldn't remove endpoint outdate info till all
// client-servers acknowledge reception
bool ret_val = serialize_proxy_data(*wdata, *writer, false, &change);
bool ret_val = serialize_writer_proxy_data(*wdata, *writer, false, &change);
if (change != nullptr)
{
// We must key-signed the CacheChange_t to avoid duplications:
Expand Down Expand Up @@ -397,7 +397,7 @@ bool EDPServer::processLocalReaderProxyData(

// unlike on EDPSimple we wouldn't remove endpoint outdate info till all
// client-servers acknowledge reception
bool ret_val = serialize_proxy_data(*rdata, *writer, false, &change);
bool ret_val = serialize_reader_proxy_data(*rdata, *writer, false, &change);
if (change != nullptr)
{
// We must key-signed the CacheChange_t to avoid duplications:
Expand Down
22 changes: 20 additions & 2 deletions src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ bool EDPSimple::processLocalReaderProxyData(
}
#endif
CacheChange_t* change = nullptr;
bool ret_val = serialize_proxy_data(*rdata, *writer, true, &change);
bool ret_val = serialize_reader_proxy_data(*rdata, *writer, true, &change);
if (change != nullptr)
{
writer->second->add_change(change);
Expand All @@ -503,14 +503,32 @@ bool EDPSimple::processLocalWriterProxyData(
#endif

CacheChange_t* change = nullptr;
bool ret_val = serialize_proxy_data(*wdata, *writer, true, &change);
bool ret_val = serialize_writer_proxy_data(*wdata, *writer, true, &change);
if (change != nullptr)
{
writer->second->add_change(change);
}
return ret_val;
}

bool EDPSimple::serialize_writer_proxy_data(
const WriterProxyData& data,
const t_p_StatefulWriter& writer,
bool remove_same_instance,
CacheChange_t** created_change)
{
return serialize_proxy_data(data, writer, remove_same_instance, created_change);
}

bool EDPSimple::serialize_reader_proxy_data(
const ReaderProxyData& data,
const t_p_StatefulWriter& writer,
bool remove_same_instance,
CacheChange_t** created_change)
{
return serialize_proxy_data(data, writer, remove_same_instance, created_change);
}

template<typename ProxyData>
bool EDPSimple::serialize_proxy_data(
const ProxyData& data,
Expand Down

0 comments on commit 34c81e6

Please sign in to comment.