Template Class Value

Class Documentation

template<typename D>
class Value

This class is the base for various value-type dds objects.

QoS, Policy, Statuses, and Topic samples are all modeled as value-types.

All objects that have a value-type have a deep-copy assignment and copy construction semantics. It should also be pointed out that value-types are not ‘pure-value-types’ in the sense that they are immutable (as in functional programming languages).

The DDS-PSM-Cxx makes value-types mutable to limit the number of copies as well as to limit the time-overhead necessary to change a value-type (note that for immutable value-types the only form of change is to create a new value-type).

Public Functions

Value &operator=(const Value &other)

Assigns new delegate to this Value

Parameters:

otherValue

bool operator==(const Value &other) const

Compare this Value with another Value

Parameters:

otherValue

Returns:

true if equal

bool operator!=(const Value &other) const

Compare this Value with another Value

Parameters:

otherValue

Returns:

true if not equal

D *operator->()

The operator->() is provided to be able to directly invoke functions on the delegate.

The decision to provide direct access to the delegate was motivated by the need for providing a way that was not invasive with respect to the CXXDDS API and yet would allow for vendor-specific extension. Thus vendor-specific extensions can be invoked on the Value and on all its subclasses as follows:

my_dds_value.standard_function();
my_dds_value->vendor_specific_extension();

Returns:

a reference to delegate.

const D *operator->() const

The operator->() is provided to be able to directly invoke functions on the delegate.

The decision to provide direct access to the delegate was motivated by the need for providing a way that was not invasive with respect to the CXXDDS API and yet would allow for vendor-specific extension. Thus vendor-specific extensions can be invoked on the Value and on all its subclasses as follows:

my_dds_value.standard_function();
my_dds_value->vendor_specific_extension();

Returns:

a reference to delegate.

Protected Functions

Value()
Value(const Value &p)

Protected Attributes

D d_