Project

General

Profile

Actions

Task #2951

closed

Improvements with Block helpers

Added by Alex Afanasyev over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Base
Target version:
Start date:
06/24/2015
Due date:
% Done:

100%

Estimated time:

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

Related issues 1 (0 open1 closed)

Related to ChronoSync - Bug #2996: Build error in state.cppClosedAlex Afanasyev06/29/2015

Actions
Actions #1

Updated by Alex Afanasyev over 9 years ago

  • Status changed from New to Code review
Actions #2

Updated by Junxiao Shi over 9 years ago

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?

Actions #3

Updated by Alex Afanasyev over 9 years ago

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.

Actions #4

Updated by Alex Afanasyev over 9 years ago

  • Status changed from Code review to Closed
Actions #5

Updated by Junxiao Shi over 9 years ago

  • Related to Bug #2996: Build error in state.cpp added
Actions

Also available in: Atom PDF