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