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

Built-in endpoints history configuration [6997] #907

Merged
merged 5 commits into from
Feb 11, 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
368 changes: 203 additions & 165 deletions include/fastrtps/rtps/attributes/RTPSParticipantAttributes.h

Large diffs are not rendered by default.

245 changes: 124 additions & 121 deletions include/fastrtps/rtps/builtin/data/ParticipantProxyData.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@

#include <chrono>

#define DISCOVERY_PARTICIPANT_DATA_MAX_SIZE 5000
#define DISCOVERY_TOPIC_DATA_MAX_SIZE 500
#define DISCOVERY_PUBLICATION_DATA_MAX_SIZE 5000
#define DISCOVERY_SUBSCRIPTION_DATA_MAX_SIZE 5000
#define BUILTIN_PARTICIPANT_DATA_MAX_SIZE 100

#define DISC_BUILTIN_ENDPOINT_PARTICIPANT_ANNOUNCER (0x00000001 << 0)
Expand All @@ -64,7 +60,7 @@
#define DISC_BUILTIN_ENDPOINT_PARTICIPANT_SECURE_DETECTOR (0x00000001 << 27)

namespace eprosima {
namespace fastrtps{
namespace fastrtps {
namespace rtps {

struct CDRMessage_t;
Expand All @@ -76,126 +72,133 @@ class WriterProxyData;
class NetworkFactory;

/**
* ParticipantProxyData class is used to store and convert the information Participants send to each other during the PDP phase.
*@ingroup BUILTIN_MODULE
*/
* ParticipantProxyData class is used to store and convert the information Participants send to each other during the PDP phase.
*@ingroup BUILTIN_MODULE
*/
class ParticipantProxyData
{
public:

ParticipantProxyData(const RTPSParticipantAllocationAttributes& allocation);

ParticipantProxyData(const ParticipantProxyData& pdata);

virtual ~ParticipantProxyData();

//!Protocol version
ProtocolVersion_t m_protocolVersion;
//!GUID
GUID_t m_guid;
//!Vendor ID
VendorId_t m_VendorId;
//!Expects Inline QOS.
bool m_expectsInlineQos;
//!Available builtin endpoints
BuiltinEndpointSet_t m_availableBuiltinEndpoints;
//!Metatraffic locators
RemoteLocatorList metatraffic_locators;
//!Default locators
RemoteLocatorList default_locators;
//!Participant name
string_255 m_participantName;
//!
InstanceHandle_t m_key;
//!
Duration_t m_leaseDuration;
public:

ParticipantProxyData(
const RTPSParticipantAllocationAttributes& allocation);

ParticipantProxyData(
const ParticipantProxyData& pdata);

virtual ~ParticipantProxyData();

//!Protocol version
ProtocolVersion_t m_protocolVersion;
//!GUID
GUID_t m_guid;
//!Vendor ID
VendorId_t m_VendorId;
//!Expects Inline QOS.
bool m_expectsInlineQos;
//!Available builtin endpoints
BuiltinEndpointSet_t m_availableBuiltinEndpoints;
//!Metatraffic locators
RemoteLocatorList metatraffic_locators;
//!Default locators
RemoteLocatorList default_locators;
//!Participant name
string_255 m_participantName;
//!
InstanceHandle_t m_key;
//!
Duration_t m_leaseDuration;
#if HAVE_SECURITY
//!
IdentityToken identity_token_;
//!
PermissionsToken permissions_token_;
//!
security::ParticipantSecurityAttributesMask security_attributes_;
//!
security::PluginParticipantSecurityAttributesMask plugin_security_attributes_;
//!
IdentityToken identity_token_;
//!
PermissionsToken permissions_token_;
//!
security::ParticipantSecurityAttributesMask security_attributes_;
//!
security::PluginParticipantSecurityAttributesMask plugin_security_attributes_;
#endif
//!
bool isAlive;
//!
ParameterPropertyList_t m_properties;
//!
UserDataQosPolicy m_userData;
//!
TimedEvent* lease_duration_event;
//!
bool should_check_lease_duration;
//!
ResourceLimitedVector<ReaderProxyData*> m_readers;
//!
ResourceLimitedVector<WriterProxyData*> m_writers;

/**
* Update the data.
* @param pdata Object to copy the data from
* @return True on success
*/
bool updateData(ParticipantProxyData& pdata);

/**
* Write as a parameter list on a CDRMessage_t
* @return True on success
*/
bool writeToCDRMessage(CDRMessage_t* msg, bool write_encapsulation);

/**
* Read the parameter list from a recevied CDRMessage_t
* @return True on success
*/
bool readFromCDRMessage(
CDRMessage_t* msg,
bool use_encapsulation,
const NetworkFactory& network);

//! Clear the data (restore to default state).
void clear();

/**
* Copy the data from another object.
* @param pdata Object to copy the data from
*/
void copy(const ParticipantProxyData& pdata);

/**
* Set participant persistent GUID_t
* @param guid valid GUID_t
*/
void set_persistence_guid(const GUID_t & guid);

/**
* Retrieve participant persistent GUID_t
* @return guid persistent GUID_t or c_Guid_Unknown
*/
GUID_t get_persistence_guid() const;

void assert_liveliness();

const std::chrono::steady_clock::time_point& last_received_message_tm() const
{
return last_received_message_tm_;
}

const std::chrono::microseconds& lease_duration() const
{
return lease_duration_;
}

private:

//! Store the last timestamp it was received a RTPS message from the remote participant.
std::chrono::steady_clock::time_point last_received_message_tm_;

//! Remote participant lease duration in microseconds.
std::chrono::microseconds lease_duration_;
//!
bool isAlive;
//!
ParameterPropertyList_t m_properties;
//!
UserDataQosPolicy m_userData;
//!
TimedEvent* lease_duration_event;
//!
bool should_check_lease_duration;
//!
ResourceLimitedVector<ReaderProxyData*> m_readers;
//!
ResourceLimitedVector<WriterProxyData*> m_writers;

/**
* Update the data.
* @param pdata Object to copy the data from
* @return True on success
*/
bool updateData(
ParticipantProxyData& pdata);

/**
* Write as a parameter list on a CDRMessage_t
* @return True on success
*/
bool writeToCDRMessage(
CDRMessage_t* msg,
bool write_encapsulation);

/**
* Read the parameter list from a recevied CDRMessage_t
* @return True on success
*/
bool readFromCDRMessage(
CDRMessage_t* msg,
bool use_encapsulation,
const NetworkFactory& network);

//! Clear the data (restore to default state).
void clear();

/**
* Copy the data from another object.
* @param pdata Object to copy the data from
*/
void copy(
const ParticipantProxyData& pdata);

/**
* Set participant persistent GUID_t
* @param guid valid GUID_t
*/
void set_persistence_guid(
const GUID_t& guid);

/**
* Retrieve participant persistent GUID_t
* @return guid persistent GUID_t or c_Guid_Unknown
*/
GUID_t get_persistence_guid() const;

void assert_liveliness();

const std::chrono::steady_clock::time_point& last_received_message_tm() const
{
return last_received_message_tm_;
}

const std::chrono::microseconds& lease_duration() const
{
return lease_duration_;
}

private:

//! Store the last timestamp it was received a RTPS message from the remote participant.
std::chrono::steady_clock::time_point last_received_message_tm_;

//! Remote participant lease duration in microseconds.
std::chrono::microseconds lease_duration_;
};

} /* namespace rtps */
Expand Down
5 changes: 4 additions & 1 deletion include/fastrtps/xmlparser/XMLParserCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ namespace eprosima {
namespace fastrtps {
namespace xmlparser {

#define draw(ident, text, ...) for (uint8_t i = ident + 1; i > 0; --i) (i == 1)? printf(text, ## __VA_ARGS__): printf("\t")
#define draw(ident, text, ...) for (uint8_t i = ident + 1; i > 0; --i) (i == 1) ? printf(text, ## __VA_ARGS__) : printf( \
"\t")

/**
* Enum class XMLP_ret, used to provide a strongly typed result from the operations within this module.
Expand Down Expand Up @@ -277,6 +278,8 @@ extern const char* PUBREADER_SUBWRITER;
extern const char* STATIC_ENDPOINT_XML;
extern const char* READER_HIST_MEM_POLICY;
extern const char* WRITER_HIST_MEM_POLICY;
extern const char* READER_PAYLOAD_SIZE;
extern const char* WRITER_PAYLOAD_SIZE;
extern const char* MUTATION_TRIES;
extern const char* ACCESS_SCOPE;
extern const char* ENABLED;
Expand Down
2 changes: 2 additions & 0 deletions resources/xsd/fastRTPS_profiles.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@
<xs:element name="initialPeersList" type="locatorListType" minOccurs="0"/>
<xs:element name="readerHistoryMemoryPolicy" type="historyMemoryPolicyType" minOccurs="0"/>
<xs:element name="writerHistoryMemoryPolicy" type="historyMemoryPolicyType" minOccurs="0"/>
<xs:element name="readerPayloadSize" type="uint32Type" minOccurs="0"/>
<xs:element name="writerPayloadSize" type="uint32Type" minOccurs="0"/>
<xs:element name="mutation_tries" type="uint32Type" minOccurs="0"/>
<xs:element name="avoid_builtin_multicast" type="boolType" minOccurs="0"/>
</xs:all>
Expand Down
Loading