Beginners thoughts on Client-Server/ Cloud!
Trivial references:
https://en.wikipedia.org/wiki/Zeus
https://en.wikipedia.org/wiki/Vajra
Trivial references:
https://en.wikipedia.org/wiki/Zeus
https://en.wikipedia.org/wiki/Vajra
typedef myLongLongMeaningfulType tMeaningfulType typedef std::map<int,std::map<int, std::vector<int> > > doubleIndexMap;
uint8_t add (uint8_t a, uint8_t b);
typedef uint8_t supportType_t; supportType_t add (supportType_t a, supportType_t b);
typedef uint16_t supportType_t;
typedef uint8_t length_t; // always stores lengths in uint8 format. typedef uint8_t area_t; // always stores area's in uint8 format.
typedef uint8_t length_t; typedef uint8_t area_t;
length_t m_boxLength = 10_CM;
area_t m_boxArea = 100_SQCM;
length_t getLength()
{
return m_boxArea; // Bug, no compiler warning. both area and length are uint8
}
if(box1.getLength() == box2.getArea()) // Bug, no compiler warning. both area and length are uint8
int X = 0XFF; // Nah! not possible int Y = 0888; // yeah, i got it right. Its a decimal 888 int Z = 0110; // Sadly, I'm still not upgraded to C++14 and i understand only decimal!!!
cMoney m1(10); // Do you think I'm worth 10USD? I'm worth 10INR. Check out my implementation! cMoney m2(10.5_inr); // We both know what I'm worth of :)
cMoney m1(10); // I'm worth 10INR. If you don't think so, init my worth in INR!!
cMoney m2(10.5_inr); cMoney m2(10.5_usd); oops, it should have been a different unit!
class cMoney
{
private:
long double value; // always store in USD
// Accept money only in acceptable currencies.
// The acceptable currencies will be defined by the user defined literals.
cMoney(long double money): value(money) {}// private, force strong types.
public:
cMoney() : value(0) {}
cMoney(const cMoney& money): value(money.value) {}
// define user defined literals.
// I will accept money only in the below currencies.
// And We both are sure how much money we are dealing with.
friend cMoney operator"" _usd(long double val);
friend cMoney operator"" _inr(long double val);
};
cMoney operator"" _usd(long double val)
{
return cMoney(val);
}
cMoney operator"" _inr(long double val)
{
return cMoney(CurrencyConversion::ConvertTo<CurrencyConversion::INR, CurrencyConversion::USD>(val));
}
//...
cMoney m1(10); // ERROR! private constructor
cMoney m2(10.5_inr); // public user defined literal creates the object with appropriate conversion and then copy creates the object.