//
-// Open Service Platform
// Copyright (c) 2013 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
// limitations under the License.
/**
-* @file FIoFileLock.h
-* @brief This is the header file for the %FileLock class.
-*
-* This header file contains the declarations of the %FileLock class.
-*/
+ * @file FIoFileLock.h
+ * @brief This is the header file for the %FileLock class.
+ *
+ * This header file contains the declarations of the %FileLock class.
+ */
#ifndef _FIO_FILE_LOCK_H_
#define _FIO_FILE_LOCK_H_
+#include <FBaseObject.h>
+
namespace Tizen { namespace Io
{
-class _FileImpl;
/**
-* @enum FileLockType
-*
-* Defines the file lock type
-*
-* @since 2.1
-*/
+ * @enum FileLockType
+ *
+ * Defines the file lock types.
+ *
+ * @since 2.1
+ */
enum FileLockType
{
- FILE_LOCK_SHARED, /**< More than one process can hold a shared file lock on a file region.
- A shared lock prevents any other process from setting an exclusive lock on the file
- region . */
- FILE_LOCK_EXCLUSIVE /**< Only one process can hold an exclusive lock on a file region.
- An exclusive lock prevents any other process from setting both shared and exclusive
- lock on the file region. */
+ FILE_LOCK_SHARED, /**< More than one process can hold a shared file lock on a file region @n
+ A shared lock prevents any other process from setting an exclusive lock on the file
+ region. */
+ FILE_LOCK_EXCLUSIVE /**< Only one process can hold an exclusive lock on a file region @n
+ An exclusive lock prevents any other process from setting both shared and exclusive
+ lock on the file region. */
};
+/**
+ * @class FileLock
+ * @brief This class provides methods to check %FileLock type and release it.
+ *
+ * @since 2.1
+ *
+ * @final This class is not intended for extension.
+ *
+ * The %FileLock class provides methods to check %FileLock type and release it.
+ *
+ * @see Tizen::Io::File
+ * @see Tizen::Io::Registry
+ */
class _OSP_EXPORT_ FileLock
: public Tizen::Base::Object
{
+
public:
/**
- * This destructor releases the file lock on the current opened file if acquired
+ * This destructor releases the file lock on the current opened file if acquired.
*
* @since 2.1
*/
/**
* Checks whether the file lock is valid. @n
- * The lock is valid unless the associated %File has been closed.
+ * The lock is valid unless the associated file has been closed.
*
* @since 2.1
*
//
// This default constructor is intentionally declared as private so that only the platform can create an instance.
//
+ // @since 2.1
+ //
FileLock(void);
//
// The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
//
+ // @since 2.1
+ //
FileLock(const FileLock& rhs);
//
// The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
//
- FileLock& operator =(const FileLock& rhs);
-
- //
- // Constructs the instance of this class.
- //
// @since 2.1
//
- // @return An error code
- // @param[in] fileImpl Am instance of _FileImpl
- // @param[in] lockType The type of file lock to be created
- // @param[in] offset The starting offset for the locked region
- // @param[in] size The size of the locked region in bytes
- // @param[in] pid process id of the proccess aquiring this lock
- // @exception E_SUCCESS The method is successful.
- // @exception E_OUT_OF_MEMORY The memory is insufficient.
- // @exception E_SYSTEM A system error has occurred.
- //
- result Construct(const _FileImpl* pFileImpl, FileLockType lockType, int offset, int size, int pid);
+ FileLock& operator =(const FileLock& rhs);
class _FileLockImpl* __pFileLockImpl;