17.1.1.3.11. GenericDataQosPolicy

class eprosima::fastdds::dds::GenericDataQosPolicy : public eprosima::fastdds::dds::Parameter_t, public eprosima::fastdds::dds::QosPolicy, public fastrtps::ResourceLimitedVector<fastrtps::rtps::octet>

Class GenericDataQosPolicy, base class to transmit user data during the discovery phase.

Subclassed by eprosima::fastdds::dds::GroupDataQosPolicy, eprosima::fastdds::dds::TopicDataQosPolicy, eprosima::fastdds::dds::UserDataQosPolicy

Public Functions

GenericDataQosPolicy(const GenericDataQosPolicy &data)

Construct from another GenericDataQosPolicy.

The resulting GenericDataQosPolicy will have the same size limits as the input attribute

Parameters
  • data: data to copy in the newly created object

GenericDataQosPolicy(ParameterId_t pid, const collection_type &data)

Construct from underlying collection type.

Useful to easy integration on old APIs where a traditional container was used. The resulting GenericDataQosPolicy will always be unlimited in size

Parameters
  • pid: Id of the parameter

  • data: data to copy in the newly created object

GenericDataQosPolicy &operator=(const collection_type &b)

Copies data from underlying collection type.

Useful to easy integration on old APIs where a traditional container was used. The resulting GenericDataQosPolicy will keep the current size limit. If the input data is larger than the current limit size, the elements exceeding that maximum will be silently discarded.

Return

reference to the current object.

Parameters
  • b: object to be copied

GenericDataQosPolicy &operator=(const GenericDataQosPolicy &b)

Copies another GenericDataQosPolicy.

The resulting GenericDataQosPolicy will have the same size limit as the input parameter, so all data in the input will be copied.

Return

reference to the current object.

Parameters
  • b: object to be copied

void set_max_size(size_t size)

Set the maximum size of the user data and reserves memory for that much.

Parameters
  • size: new maximum size of the user data. Zero for unlimited size

const collection_type &dataVec() const

Return

const reference to the internal raw data.

void clear() override

Clears the QosPolicy object.

const collection_type &data_vec() const

Returns raw data vector.

Return

raw data as vector of octets.

collection_type &data_vec()

Returns raw data vector.

Return

raw data as vector of octets.

void data_vec(const collection_type &vec)

Sets raw data vector.

Parameters
  • vec: raw data to set.

const collection_type &getValue() const

Returns raw data vector.

Return

raw data as vector of octets.

void setValue(const collection_type &vec)

Sets raw data vector.

Parameters
  • vec: raw data to set.