2ab0af2923c2e7bcae5d0fc49f30b99d130ea9aa
[platform/framework/native/appfw.git] / inc / FBaseObject.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file                FBaseObject.h
19  * @brief               This is the header file for the %Object class.
20  *
21  * This header file contains the declarations of the %Object class. @n
22  * This class defines a set of behaviors shared by all Tizen classes.
23  */
24 #ifndef _FBASE_OBJECT_H_
25 #define _FBASE_OBJECT_H_
26
27 #include <FBaseTypes.h>
28 #include <FOspConfig.h>
29 #include <FOspCompat.h>
30
31
32 namespace Tizen { namespace Base
33 {
34 /**
35  * @class       Object
36  * @brief       This class is the root class of %Tizen.
37  *
38  * @since 2.0
39  *
40  * The %Object class defines a set of behaviors and characteristics shared by all the other classes.
41  *
42  * The derived classes can override some of these methods, such as the Equals() method, which tests for object equivalence.
43  */
44 class _OSP_EXPORT_ Object
45 {
46 public:
47         /**
48          *      This is the default constructor for this class.
49          *
50          *  @since 2.0
51          */
52         Object(void);
53
54         /**
55          *      This is the destructor for this class.
56          *
57          *  @since 2.0
58          */
59         virtual ~Object(void);
60
61         /**
62          *      Checks whether the value of the specified instance is equal to the value of the current instance of %Object.
63          *
64          *  @since 2.0
65          *
66          *      @return                 @c true if the value of the specified instance of %Object is equal to the value of the current instance of %Object, @n
67          *                              else @c false
68          *      @param[in]      obj     An instance of %Object to compare
69          *      @remarks        The default implementation of this method returns @c true
70          *                              if the two instances have the same address. @n
71          *                              The method can be overridden to support value equality. Furthermore, this method must return the same result as the equality operator.
72          */
73         virtual bool Equals(const Object& obj) const;
74
75         /**
76          *      Gets the hash value of the current instance of %Object.
77          *
78          *  @since 2.0
79          *
80          *      @return         An integer value indicating the hash value of the current instance of %Object
81          *      @remarks        Two equal instances must return the same hash value. For better performance,
82          *                              the used hash function must generate a random distribution for all inputs. @n
83          *                              The default implementation of this method returns the address of the current instance.
84          */
85         virtual int GetHashCode(void) const;
86
87 protected:
88         /**
89          * This is the copy constructor for the %Object class.
90          *
91          * @param[in]   obj     An instance of %Object
92          */
93         Object(const Object& obj);
94
95         /**
96          * Assigns the value of the specified instance to the current instance of %Object.
97          *
98          * @param[in]   rhs     An instance of %Object
99          */
100         Object& operator =(const Object& rhs);
101
102         //
103         // This method is for internal use only. Using this method can cause behavioral, security-related,
104         // and consistency-related issues in the application.
105         // This method is reserved and may change its name at any time without prior notice.
106         //
107         // @since 2.0
108         //
109         virtual void Object_Reserved1(void) { }
110
111 }; // Object
112
113 }} // Tizen::Base
114
115 #endif //_FBASE_OBJECT_H_