| 1 | /*************************************************************************** |
| 2 | CObject.h - description |
| 3 | ------------------- |
| 4 | begin : December 29th, 2008 |
| 5 | copyright : (C) 2008 by Duong Khang NGUYEN |
| 6 | email : neoneurone @ gmail com |
| 7 | |
| 8 | $Id: CObject.h 449 2010-05-20 18:46:59Z neoneurone $ |
| 9 | ***************************************************************************/ |
| 10 | |
| 11 | /*************************************************************************** |
| 12 | * * |
| 13 | * This program is free software; you can redistribute it and/or modify * |
| 14 | * it under the terms of the GNU General Public License as published by * |
| 15 | * the Free Software Foundation; either version 2 of the License, or * |
| 16 | * any later version. * |
| 17 | * * |
| 18 | ***************************************************************************/ |
| 19 | |
| 20 | #ifndef _SPF_SYSTEM_COBJECT_H_ |
| 21 | #define _SPF_SYSTEM_COBJECT_H_ 1 |
| 22 | |
| 23 | // Sharp Plus Framework definitions |
| 24 | #include "SharpPlus.h" |
| 25 | |
| 26 | |
| 27 | SPF_NAMESPACE_BEGIN(System) |
| 28 | |
| 29 | // Framework System::String class forward declaration |
| 30 | class String; |
| 31 | |
| 32 | // Framework System::Type class forward declaration |
| 33 | class Type; |
| 34 | |
| 35 | // Framework System::NullValue class forward declaration |
| 36 | class NullValue; |
| 37 | |
| 38 | |
| 39 | /** |
| 40 | Supports all classes in the Sharp Plus Framework class hierarchy |
| 41 | and provides low-level services to derived classes. |
| 42 | */ |
| 43 | class Object |
| 44 | { |
| 45 | public: |
| 46 | Object(); |
| 47 | Object(const NullValue& null); |
| 48 | virtual ~Object(); |
| 49 | |
| 50 | bool IsNull() const; |
| 51 | |
| 52 | /** |
| 53 | Determines whether the specified Object is equal to the current Object. |
| 54 | |
| 55 | \param obj The Object to compare with the current Object. |
| 56 | \return true if the specified Object is equal to the current Object; |
| 57 | otherwise, false. |
| 58 | */ |
| 59 | virtual bool Equals(const Object& obj) const; |
| 60 | |
| 61 | virtual String ToString() const; |
| 62 | virtual Type GetType() const; |
| 63 | |
| 64 | // Operators |
| 65 | virtual Object& operator=(const NullValue& null); |
| 66 | virtual bool operator==(const Object& obj) const; |
| 67 | virtual bool operator!=(const Object& obj) const; |
| 68 | |
| 69 | protected: |
| 70 | bool mbIsNull; /// Avoids circular dependency from System::NullValue |
| 71 | |
| 72 | }; // class Object |
| 73 | |
| 74 | // Defines the member pointer types. They are used to build the delegate system. |
| 75 | typedef void (Object::* MemberPointer0)(); |
| 76 | typedef void (Object::* MemberPointer1)(Object); |
| 77 | typedef Object (Object::* ObjectMemberPointer0)(); |
| 78 | typedef Object (Object::* ObjectMemberPointer1)(Object); |
| 79 | |
| 80 | |
| 81 | SPF_NAMESPACE_END |
| 82 | |
| 83 | #endif |