Task #2951
closed
Improvements with Block helpers
Added by Alex Afanasyev over 9 years ago.
Updated over 9 years ago.
Description
This task includes several improvements:
- complete doxygen documentation for all helper
- move implementation to
.cpp
where possible
- add additional helpers to encode/read
std::string
- Status changed from New to Code review
Design question (probably not directly related to this issue):
Templates that accept EncodingBuffer
and EncodingEstimator
are declared as:
template<Tag TAG>
size_t
wireEncode(EncodingImpl<TAG>& encoder);
and instantiated as:
template
size_t
wireEncode<EncoderTag>(EncodingImpl<EncoderTag>& encoder);
template
size_t
wireEncode<EstimatorTag>(EncodingImpl<EstimatorTag>& estimator);
An alternate is to declare the template as:
template<typename Encoder>
size_t
wireEncode(Encoder& encoder);
and instantiated as:
template
size_t
wireEncode<EncodingBuffer>(EncodingBuffer& encoder);
template
size_t
wireEncode<EncodingEstimator>(EncodingEstimator& estimator);
What's the rationale of choosing the first over the second?
The reason I chose to use "bool" as a template parameter to guarantee that there can be only two versions of this method in existence: one with true and one with false.
- Status changed from Code review to Closed
- Related to Bug #2996: Build error in state.cpp added
Also available in: Atom
PDF