As agreed during a discussion with Monty, let's change the Protocol API from:
- Remove the String* argument
- Rename store(float) and store(double) to store_float() and store_double(), to avoid ambiguity, and to avoid explicit cast in calls.
Rationale to remove the String* argument:
- The String buffer is only needed for Protocol_text. Instead of creating a String buffer on stack for every Field sent, the buffer will go to as a protected member to the class:
so will be created only once per session. This should give a slight performance improvement.
- It will remove a confusing code, e.g.:
A reader has questions when seeing this code: why a NULL String is passed? when it's important to pass a non-NULL pointer?
- It will make the code more symmetric across various data types.
Notice, other methods do not have any String buffer parameter: