#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

#define tf(IsTrue) ((IsTrue) ? "True" : "False")

int main() {
   uCalc uc;
   // Initial state: Double is the default
   cout << "Double is default: " << tf(uc.DataTypeOf("double").IsDefault()) << endl;
   cout << "Int64 is default: " << tf(uc.DataTypeOf("int64").IsDefault()) << endl;
   cout << "Current default: " << uc.DefaultDataType().Name() << endl;
   cout << "---" << endl;

   // Set Int64 as the default
   uc.DataTypeOf("int64").IsDefault(true);
   cout << "Double is default: " << tf(uc.DataTypeOf("double").IsDefault()) << endl;
   cout << "Int64 is default: " << tf(uc.DataTypeOf("int64").IsDefault()) << endl;
   cout << "Current default: " << uc.DefaultDataType().Name() << endl;
   cout << "---" << endl;

   // Revert back to Double by un-setting Int64
   uc.DataTypeOf("int64").IsDefault(false);
   cout << "Double is default: " << tf(uc.DataTypeOf("double").IsDefault()) << endl;
   cout << "Int64 is default: " << tf(uc.DataTypeOf("int64").IsDefault()) << endl;
   cout << "Current default: " << uc.DefaultDataType().Name() << endl;
}