Update doxygen
[platform/framework/native/appfw.git] / inc / FIoFileLock.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2013 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  * @file        FIoFileLock.h
19  * @brief       This is the header file for the %FileLock class.
20  *
21  * This header file contains the declarations of the %FileLock class.
22  */
23
24 #ifndef _FIO_FILE_LOCK_H_
25 #define _FIO_FILE_LOCK_H_
26
27 namespace Tizen { namespace Io
28 {
29
30 /**
31  * @enum FileLockType
32  *
33  * Defines the file lock types.
34  *
35  * @since       2.1
36  */
37 enum FileLockType
38 {
39         FILE_LOCK_SHARED,               /**< More than one process can hold a shared file lock on a file region @n
40                                                         A shared lock prevents any other process from setting an exclusive lock on the file
41                                                         region. */
42         FILE_LOCK_EXCLUSIVE             /**< Only one process can hold an exclusive lock on a file region @n
43                                                         An exclusive lock prevents any other process from setting both shared and exclusive
44                                                         lock on the file region. */
45 };
46
47 /**
48  * @class       FileLock
49  * @brief       This class provides methods to check %FileLock type and release it.
50  *
51  * @since       2.1
52  *
53  * @final       This class is not intended for extension.
54  *
55  * The %FileLock class provides methods to check %FileLock type and release it.
56  *
57  * @see Tizen::Io::File
58  * @see Tizen::Io::Registry
59  */
60 class _OSP_EXPORT_ FileLock
61         : public Tizen::Base::Object
62 {
63
64 public:
65         /**
66         * This destructor releases the file lock on the current opened file if acquired.
67         *
68         * @since          2.1
69         */
70         virtual ~FileLock(void);
71
72         /**
73         * Checks whether the file lock is shared.
74         *
75         * @since          2.1
76         *
77         * @return         @c true if the file lock is shared, @n
78         *                    else @c false
79         */
80         bool IsShared(void) const;
81
82         /**
83         * Checks whether the file lock is exclusive.
84         *
85         * @since          2.1
86         *
87         * @return         @c true if the file lock is exclusive, @n
88         *                    else @c false
89         */
90         bool IsExclusive(void) const;
91
92         /**
93         * Checks whether the file lock is valid. @n
94         * The lock is valid unless the associated file has been closed.
95         *
96         * @since          2.1
97         *
98         * @return         @c true if the file lock is valid, @n
99         *                    else @c false
100         */
101         bool IsValid(void) const;
102
103 private:
104         //
105         // This default constructor is intentionally declared as private so that only the platform can create an instance.
106         //
107         // @since       2.1
108         //
109         FileLock(void);
110
111         //
112         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
113         //
114         // @since       2.1
115         //
116         FileLock(const FileLock& rhs);
117
118         //
119         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
120         //
121         // @since       2.1
122         //
123         FileLock& operator =(const FileLock& rhs);
124
125         class _FileLockImpl* __pFileLockImpl;
126
127         friend class _FileLockImpl;
128
129 }; // FileLock
130
131 }} // Tizen::Io
132
133 #endif // _FIO_FILE_LOCK_H_