Merge "Update deprecated libprivilege-control API functions." into tizen
[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 namespace Tizen { namespace Base
32 {
33 /**
34  * @class       Object
35  * @brief       This class is the root class of %Tizen.
36  *
37  * @since 2.0
38  *
39  * The %Object class defines a set of behaviors and characteristics shared by all the other classes.
40  *
41  * The derived classes can override some of these methods, such as the Equals() method, which tests for object equivalence.
42  */
43 class _OSP_EXPORT_ Object
44 {
45 public:
46         /**
47          *      This is the default constructor for this class.
48          *
49          *  @since 2.0
50          */
51         Object(void);
52
53         /**
54          *      This is the destructor for this class.
55          *
56          *  @since 2.0
57          */
58         virtual ~Object(void);
59
60         /**
61          *      Checks whether the value of the specified instance is equal to the value of the current instance of %Object.
62          *
63          *  @since 2.0
64          *
65          *      @return                 @c true if the value of the specified instance of %Object is equal to the value of the current instance of %Object, @n
66          *                                      else @c false
67          *      @param[in]      obj     An instance of %Object to compare
68          *      @remarks
69          *                              - The default implementation of this method returns @c true,
70          *                              if the two instances have the same address.
71          *                              - The method can be overridden to support value equality.
72          *                              Furthermore, this method must return the same result as the equality operator.
73          */
74         virtual bool Equals(const Object& obj) const;
75
76         /**
77          *      Gets the hash value of the current instance of %Object.
78          *
79          *  @since 2.0
80          *
81          *      @return         The integer value that indicates the hash value of the current instance of %Object
82          *      @remarks
83          *                              - Two equal instances must return the same hash value. @n
84          *                              For better performance, the used hash function must generate a random distribution for all the inputs.
85          *                              - The default implementation of this method returns the address of the current instance.
86          */
87         virtual int GetHashCode(void) const;
88
89 protected:
90         /**
91          * This is the copy constructor for the %Object class.
92          *
93          * @param[in]   obj     An instance of %Object
94          */
95         Object(const Object& obj);
96
97         /**
98          * Assigns the value of the specified instance to the current instance of %Object.
99          *
100          * @param[in]   rhs     An instance of %Object
101          */
102         Object& operator =(const Object& rhs);
103
104         //
105         // This method is for internal use only. Using this method can cause behavioral, security-related,
106         // and consistency-related issues in the application.
107         // This method is reserved and may change its name at any time without prior notice.
108         //
109         // @since 2.0
110         //
111         virtual void Object_Reserved1(void) { }
112
113 public:
114         // This pointer is initalized null. It is used to return null pointer.
115         //
116         // @since 3.0
117         //
118         static Object* pNullObj;
119 }; // Object
120
121 }} // Tizen::Base
122
123 #endif //_FBASE_OBJECT_H_