Commit e5b3471d authored by Kazunori Fujiwara's avatar Kazunori Fujiwara
Browse files

[3015] Added Notes about the use of int64_t, long long, long and int

parent 1176cc48
...@@ -166,6 +166,8 @@ public: ...@@ -166,6 +166,8 @@ public:
/// the right type. Set the value and return true if the Elements /// the right type. Set the value and return true if the Elements
/// is of the correct type /// is of the correct type
/// ///
/// Notes: Read notes of IntElement definition about the use of
/// long long int, long int and int.
//@{ //@{
virtual bool setValue(const long long int v); virtual bool setValue(const long long int v);
bool setValue(const long int i) { return (setValue(static_cast<long long int>(i))); }; bool setValue(const long int i) { return (setValue(static_cast<long long int>(i))); };
...@@ -273,6 +275,9 @@ public: ...@@ -273,6 +275,9 @@ public:
/// underlying system). /// underlying system).
/// (Note that that is different from an NullElement, which /// (Note that that is different from an NullElement, which
/// represents an empty value, and is created with Element::create()) /// represents an empty value, and is created with Element::create())
///
/// Notes: Read notes of IntElement definition about the use of
/// long long int, long int and int.
//@{ //@{
static ElementPtr create(); static ElementPtr create();
static ElementPtr create(const long long int i); static ElementPtr create(const long long int i);
...@@ -373,6 +378,16 @@ public: ...@@ -373,6 +378,16 @@ public:
//@} //@}
}; };
/// Notes: IntElement type is changed to int64_t.
/// Due to C++ problems on overloading and automatic type conversion,
/// (C++ tries to convert integer type values and reference/pointer
/// if value types do not match exactly)
/// We decided the storage as int64_t,
/// three (long long, long, int) override function defintions
/// and cast int/long/long long to int64_t via long long.
/// Therefore, call by value methods (create, setValue) have three
/// (int,long,long long) definitions. Others use int64_t.
///
class IntElement : public Element { class IntElement : public Element {
int64_t i; int64_t i;
private: private:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment