Hello,
PRESENTATION
I currently working on an external ram manager library.
It's not only offering method to read/write in/to ram like several other library.
But this librairy taking care of automatic addressing inner the external ram ship.
With this librairy you can use dynamic addressing during execution. You dont have to calculate the space you need and determine the place you go into the external ram ship.
The best point : whatever the place you need, you just have to keep a 16bits address, only 2 bytes. Even if you need an array of hundred of double, it's just use 16 bits of arduino ram.
All source code are available there :
Github.com
But I have a problem :
To make difference between standard variable and external ship variable but keeping code readable, I define _uint16_t class similar as uint16_t to define 16 bits variable into external ram.
And use same way with _uint32_t / uint32_t... int16_t, double, float... all numerical variable.
All _uint16_t, _double, etc... (note the underscore caractere) inherit from ram_vars
class _uint16_t : public ram_vars
class _uint32_t : public ram_vars
class _double : public ram_vars
PROBLEM
I try to overload arithmetic operator with arithmetic variable and ram_vars variable too.
So, I have define method using ram_vars parameter and method that use Template parameter.
ram_vars &operator+=( const ram_vars &val )
template <typename T> ram_vars &operator+=( const T val )
And I have trouble with this point : all operation goes with template method even if specific method have been defined.
How can I force called method when operating with ram_vars operand ?
_uint16_t varA = _uint16_t();
varA.alloc(); // allocating space in external ram ship and retrieving address
_uint16_t varB = _uint16_t();
varB.alloc(); // allocating space in external ram ship and retrieving address
varA = 12;
varB = 5;
varA += 6; // now, varA = 18 : using template method. OK
varA += varB; // using template method instead of specific methode...