Why is there such a mixture of
type = getSomething()
and
error = getSomethingElse(referenceToType)
e.g.
Mighhtily confusing.
Why is there such a mixture of
type = getSomething()
and
error = getSomethingElse(referenceToType)
e.g.
Mighhtily confusing.
In general, the DDS API (and RTI Connext DDS' implementation of it), tends to favor the idiom where an error code is returned by function calls which may fail, with other output values returned via formal parameters.
There are few exception to this pattern, namely the various create_XXX() functions, for which the only "error code" returned is a nil return value, and some "accessor" methods (like DDS_DataWriter_get_topic), which are never expected to fail in a sound implementation.