diff options
Diffstat (limited to 'tests/cpp/include/class_obj/003-comparable.h')
-rw-r--r-- | tests/cpp/include/class_obj/003-comparable.h | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/tests/cpp/include/class_obj/003-comparable.h b/tests/cpp/include/class_obj/003-comparable.h deleted file mode 100644 index 8a384dc..0000000 --- a/tests/cpp/include/class_obj/003-comparable.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - * - * Test Classes and objects - * 003-comparable.phpt - * - */ - - - - -/** - * Set up namespace - */ -namespace TestBaseClass { - - - /** - * Test custom comparison operator - */ - class Comparable : public Php::Base - { - private: - /** - * Internal value of the class - * @var int - */ - static int count; - int _nom; - int _value; - - public: - /** - * C++ constructor - */ - Comparable() - { - // start with random value - //_value = rand(); - _nom = ++count; - _value = _nom%2+1; - } - - /** - * C++ destructor - */ - virtual ~Comparable() {} - - /** - * Cast the object to a string - * @return std::string - */ - std::string __toString() - { - return "Obj#" + std::to_string(_nom) + "(" + std::to_string(_value) + ")"; - } - - /** - * Compare with a different object - * @param that - * @return int - */ - int __compare(const Comparable &that) const - { - return _value - that._value; - } - }; - int Comparable::count = 0; - - -/** - * End of namespace - */ -} - |