Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid problems with template method inlining. [7601] #1009

Merged
merged 1 commit into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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