* @file FBaseBuffer.h
* @brief This is the header file for the %Buffer class.
*
- * This header file contains the declarations of the %Buffer class.
+ * This header file contains the declarations of the %Buffer classes.
*/
#ifndef _FBASE_BUFFER_H_
#define _FBASE_BUFFER_H_
*
* The %Buffer class represents a linear finite sequence of elements of the same type.
* It is a means of defining an aggregation of the same type of objects, similar to an array.
- *
+ * @n
* For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/base/buffer.htm">Buffer</a>.
*
* @see Tizen::Base::BufferBase
public:
/**
- * This is the default constructor for this class. @n
- * After creating an instance of the %Buffer class, one of the Construct() methods must be called explicitly to initialize this instance.
+ * This is the default constructor for this class.
+ *
+ * @since 2.0
*
- * @since 2.0
+ * @remarks After creating an instance of the %Buffer class, one of the Construct() methods must be called explicitly to initialize this instance.
+ * @see Construct()
*/
Buffer(void)
{
*
* @param[in] buffer The other %Buffer instance
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG Either of the following conditions has occured:
- * - The specified input parameter is invalid.
- * - The source buffer has not been constructed.
+ * @exception E_INVALID_ARG The specified input parameter is invalid, or
+ * the source buffer is not constructed.
* @see Buffer()
*/
result Construct(const Buffer< Type >& buffer)
* @since 2.0
*
* @return An error code
- * @param[in] pBuffer The shared buffer
+ * @param[in] pBuffer The buffer which is shared
* @param[in] index The starting index of the buffer from where the first @c byte value is read
- * @param[in] length The number of bytes to read from the given buffer @n
- * This is the limit of this instance.
+ * @param[in] length The number of bytes to read from the given buffer @n This is a limit of this instance.
* @param[in] capacity The capacity of this instance
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG Either of the following conditions has occured:
- * - A specified input parameter is invalid.
- * - The specified @c pBuffer is @c null.
- * @exception E_OUT_OF_RANGE Either of the following conditions has occured:
- * - The specified @c index is outside the bounds of the data structure.
- * - The specified @c index is larger than the specified @c length.
+ * @exception E_INVALID_ARG A specified input parameter is invalid, or
+ * the @c pBuffer is @c null.
+ * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the data structure, or
+ * the @c index is larger than the @c length.
*/
result Construct(const Type* pBuffer, int index, int length, int capacity)
{
}
/**
- * Returns a reference to the element indicated by the given @c index.
+ * This subscript operator returns the reference to the element indicated by the given @c index.
*
* @since 2.0
*
* @return A reference to the indexed element
* @param[in] index The index of the element @n
- * It must be less than the limit.
+ * It must be less than the limit.
*/
Type& operator [](int index) const
{
}
/**
- * Checks whether two %Buffer instances are equal.
+ * Overloaded equality operator to compare two %Buffer instances.
*
* @since 2.0
*
- * @return @c true if the two %Buffer instances are equal, @n
+ * @return @c true if the buffers being compared are equal, @n
* else @c false
- * @param[in] buffer The buffer to compare with the current instance of %Buffer
- * @remarks This method returns @c true only if the two buffers have the same number of remaining elements @n
- * and the sequences of the remaining elements are equal (considered independent of their starting positions).
+ * @param[in] buffer The buffer to compare with the current instance of %Buffer
+ * @remarks This method returns @c true only if the two buffers have the same number of remaining elements @n
+ * and the two sequences of remaining elements are equal (considered independently of their starting positions).
* @see Equals()
*/
bool operator ==(const Buffer< Type >& buffer) const
}
/**
- * Checks whether two %Buffer instances are not equal.
+ * Checks whether the two %Buffer instances are not equal.
*
* @since 2.0
*
- * @return @c true if the two %Buffer instances are not equal, @n
+ * @return @c true if the buffers are not equal, @n
* else @c false
- * @param[in] buffer The buffer to compare with the current instance of %Buffer
- * @remarks This method returns @c false only if the two buffers have the same @n
- * number of remaining elements and the sequences of the remaining elements are equal @n
- * (considered independent of their starting positions).
+ * @param[in] buffer The buffer to compare with the current instance of %Buffer
+ * @remarks This method returns @c false only if the two buffers being compared have the same @n
+ * number of remaining elements and the two sequences of remaining elements are equal @n
+ * (considered independently of their starting positions).
* @see Equals()
*/
bool operator !=(const Buffer< Type >& buffer) const
/**
* Copies the remaining elements of the input %Buffer instance into the current
* %Buffer instance. @n
- * It returns @c E_OVERFLOW if the remaining part of the current instance is smaller
+ * It returns E_OVERFLOW if the remaining part of the current instance is smaller
* than the remaining part of the input instance.
*
* @since 2.0
*
* @return An error code
- * @param[in] buffer The source buffer from which bytes are read @n
- * It must not be the current instance of %Buffer.
+ * @param[in] buffer The source buffer from which bytes are read @n
+ * It must not be the current instance of %Buffer.
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG Either of the following conditions has occured:
- * - The specified input parameter is invalid.
- * - The source buffer is same as destination buffer,
+ * @exception E_INVALID_ARG The specified input parameter is invalid, or
+ * the source buffer is same as destination buffer,
* that is, the current instance of %Buffer.
- * @exception E_OVERFLOW Either of the following conditions has occured:
- * - The operation (arithmetic/casting/conversion) has caused an overflow.
- * - The number of remaining bytes in the current buffer is less than
- * the number of remaining bytes in the given buffer.
+ * @exception E_OVERFLOW The operation (arithmetic/casting/conversion) has caused an overflow. @n
+ * The number of remaining bytes of the current buffer is less than
+ * the number of remaining bytes of the given buffer.
* @remarks After the copy operation, the current (destination) buffer's position and the given
* (source) buffer's position are incremented by the number of elements copied (the number
* of remaining elements of the given buffer). @n
* If the remaining part of the current instance is not less than the remaining part of the input instance,
- * the effect of this method and the ReadFrom() method is the same. @n
- * But when the remaining part of the current instance is less, the ReadFrom() method copies the number of remaining
- * elements of the current instance while this method returns @c E_OVERFLOW and does not transfer.
+ * the effect of this method and the ReadFrom() method is the same. But when the remaining part of the
+ * current instance is less, ReadFrom() method copies the number of remaining elements of the current
+ * instance while this method returns E_OVERFLOW and does not transfer.
+ * @see ReadFrom()
*
* The following example demonstrates how to use the %CopyFrom() method.
*
}
/**
- * Reads the value of the current position in the buffer, and then increments the position. @n
- * Provides a way to perform relative indexing and reading.
+ * Reads the value from the current position in the buffer, and then increments the position. @n
+ * Provides a way for relative indexing and reading.
*
* @since 2.0
*
* @return An error code
- * @param[out] value The value at the current position
+ * @param[out] value The value at the current position
* @exception E_SUCCESS The method is successful.
- * @exception E_UNDERFLOW Either of the following conditions has occured:
- * - The operation (arithmetic/casting/conversion) has caused an underflow.
- * - The current position is greater than the limit.
+ * @exception E_UNDERFLOW The operation (arithmetic/casting/conversion) has caused an underflow. @n
+ * The current position is greater than the limit.
* @see Set()
*/
result Get(Type& value)
/**
* Reads the value at the given @c index. @n
- * Provides a way to preform absolute indexing and reading.
+ * Provides a way for absolute indexing and reading.
*
* @since 2.0
*
* @return An error code
- * @param[in] index The buffer index from where the value is read
- * @param[out] value The value at the given index
- * @exception E_SUCCESS The method is successful.
- * @exception E_OUT_OF_RANGE Either of the following conditions has occured:
- * - The specified @c index is outside the bounds of the data structure.
- * - The specified @c index is greater than the limit.
- * - The specified @c index is less than @c 0.
+ * @param[in] index The index into the buffer from where the value is read
+ * @param[out] value The value at the given index
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_OUT_OF_RANGE The specified @c index is outside the bounds of the data structure. @n
+ * The @c index is greater than the limit or less than @c 0.
* @see Set()
*/
result Get(int index, Type& value) const
/**
- * Copies the specified range of values from the calling buffer to the specified @c index of the destination array.
+ * Copies the specified range of values from the calling buffer to the specified destination array as per the given @c index of the array.
*
* @since 2.0
*
* @return An error code
- * @param[out] pArray A pointer to the array into which the values are written
- * @param[in] index The starting index in the array where the first value is written
- * @param[in] length The number of values to write from the buffer to the array
+ * @param[out] pArray A pointer to the array into which values are written
+ * @param[in] index The starting index in the array of the first value to write
+ * @param[in] length The number of values from the buffer to write to the array
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG Either of the following conditions has occured:
- * - A specified input parameter is invalid.
- * - The specified @c pArray is @c null.
- * @exception E_OUT_OF_RANGE Either of the following conditions has occured:
- * - The specified @c index is outside the bounds of the data structure.
- * - The specified @c index or @c length is less than @c 0.
- * @exception E_UNDERFLOW Either of the following conditions has occured:
- * - The operation (arithmetic/casting/conversion) has caused an underflow.
- * - The remaining elements of this buffer are smaller than the specified @c length.
- * @remarks After the copy operation, the position is incremented by @c length.
+ * @exception E_INVALID_ARG A specified input parameter is invalid, or
+ * the @c pArray is @c null.
+ * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure, or
+ * the @c index or length is less than @c 0.
+ * @exception E_UNDERFLOW The operation (arithmetic/casting/conversion) has caused an underflow. @n
+ * The remaining elements of this buffer are smaller than @c length.
+ * @remarks After the copy operation, the position is incremented by @c length.
* @see SetArray()
*/
result GetArray(Type* pArray, int index, int length)
/**
* Transfers bytes from the input buffer into the calling buffer. @n
- * If the empty space in the calling buffer is larger than the remaining values of the input buffer,
- * then all the remaining elements from the input are copied to the destination. @n
+ * If the empty space in the calling buffer is larger than the remaining values from the input buffer,
+ * all the remaining elements from the input are copied to the destination. @n
* Otherwise, the number of bytes copied equals the number of elements remaining in the calling buffer.
*
* @since 2.0
*
* @return An error code
- * @param[in] buffer The source buffer from where the bytes are read @n
- * It must not be this buffer.
+ * @param[in] buffer The source buffer from where the bytes are read @n
+ * It must not be this buffer.
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG Either of the following conditions has occured:
- * - The specified input parameter is invalid.
- * - The given buffer is same as the current buffer instance.
+ * @exception E_INVALID_ARG The specified input parameter is invalid. @n
+ * The given buffer is same as the current buffer instance.
* @remarks After the copy operation, the current (destination) buffer's position and the given
- * (source) buffer's position are incremented by the number of elements copied (the smaller value
+ * (source) buffer's position are incremented by the number of elements copied (the smaller value
* between the number of elements remaining in the calling buffer and the source buffer). @n
- * If there are more elements remaining in the calling buffer than the elements remaining in the input instance,
- * then this method is equivalent to the CopyFrom() method. @n
- * If there are less elements remaining in the calling buffer, then the %CopyFrom() method
- * returns @c E_OVERFLOW and does not transfer, while this method copies the number of remaining elements
- * of the current instance.
+ * If there are more elements remaining in the calling buffer than elements remaining in the input instance,
+ * this method is equivalent to CopyFrom() method. If there are less remaining elements in the
+ * calling buffer, the %CopyFrom() method returns @c E_OVERFLOW and does not transfer
+ * while this method copies the number of remaining elements of the current instance.
+ * @see CopyFrom()
*
* The following example demonstrates how to use the %ReadFrom() method.
*
/**
* Writes the specified @c value into the current buffer instance at the current position,
* and then increments the position. @n
- * Provides a way to perform relative indexing and writing.
+ * Provides a way for relative indexing and writing.
*
* @since 2.0
*
* @return An error code
- * @param[in] value The value to write into the calling %Buffer
+ * @param[in] value The value to write to the calling %Buffer
* @exception E_SUCCESS The method is successful.
- * @exception E_OVERFLOW Either of the following conditions has occured:
- * - The operation (arithmetic/casting/conversion) has caused an overflow.
- * - The current position is not smaller than the limit.
+ * @exception E_OVERFLOW The operation (arithmetic/casting/conversion) has caused an overflow. @n
+ * The current position is not smaller than the limit.
* @see Get()
*/
result Set(Type value)
}
/**
- * Writes the specified @c value into the current instance of the buffer at the given @c index. @n
- * Provides a way to perform absolute indexing and writing.
+ * Writes the specified @c value into the current instance of buffer at the given @c index. @n
+ * Provides a way for absolute indexing and writing.
*
* @since 2.0
*
* @return An error code
- * @param[in] index The index at which the value is written
- * @param[in] value The value to write
+ * @param[in] index The index at which the value is written
+ * @param[in] value The value to write
* @exception E_SUCCESS The method is successful.
- * @exception E_OUT_OF_RANGE Either of the following conditions has occured:
- * - The specified index is outside the bounds of the data structure.
- * - The specified @c index is not smaller than the limit.
- * - The specified @c index is less than @c 0.
+ * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure, or
+ * the @c index is not smaller than the limit or less than @c 0.
* @see Get()
*/
result Set(int index, Type value)
* @since 2.0
*
* @return An error code
- * @param[in] pArray A pointer to the array from where the values are read
- * @param[in] index The starting index of the array
- * @param[in] length The number of values read from the given array
+ * @param[in] pArray A pointer to the array from where the values are read
+ * @param[in] index The starting index of the array
+ * @param[in] length The number of values read from the given array
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG Either of the following conditions has occured:
- * - A specified input parameter is invalid.
- * - The specified @c pArray is @c null.
- * @exception E_OUT_OF_RANGE Either of the following conditions has occured:
- * - The specified @c index is outside the bounds of the data structure.
- * - The specified @c index or @c length is less than @c 0.
- * @exception E_OVERFLOW Either of the following conditions has occured:
- * - The operation (arithmetic/casting/conversion) has caused an overflow.
- * - The remainder of this buffer is smaller than the specified @c length.
- * @remarks This method copies @c length number of values starting from the given @c index of the source array,
- * into the calling buffer, starting from the current position. @n
+ * @exception E_INVALID_ARG A specified input parameter is invalid, or
+ * the @c pArray is @c null.
+ * @exception E_OUT_OF_RANGE The specified index is outside the bounds of the data structure, or
+ * the @c index or length is less than @c 0.
+ * @exception E_OVERFLOW The operation (arithmetic/casting/conversion) has caused an overflow. @n
+ * The remainder of this buffer is smaller than @c length.
+ * @remarks This method copies @c length number of values from the source array,
+ * starting from the given @c index in the array, into the calling
+ * buffer, starting at the current position.
* After the copy operation, the position is incremented by @c length.
* @see GetArray()
*/
/**
* Creates a new %Buffer instance. @n
* Its content is a shared portion of
- * the calling %Buffer instance that starts from the current position of the calling %Buffer instance.
+ * the calling %Buffer instance that starts from the current position of calling %Buffer instance.
*
* @since 2.0
*
- * @return A pointer to the new %Buffer instance
- * @remarks The content of the new buffer starts at the current position of this %Buffer instance. @n
+ * @return A pointer to the new buffer
+ * @remarks The content of the new buffer starts at the current position of this instance of %Buffer.
* The new buffer's position is @c 0, its capacity and limit is
* the number of bytes remaining in the current instance of %Buffer,
* and it is marked as undefined.
}
/**
- * Compares the Object instance with the current %Buffer instance for equality.
+ * Compares the Object instance with the calling %Buffer instance for equivalence.
*
* @since 2.0
*
- * @return @c true if the input equals the current %Buffer instance, @n
+ * @return @c true if the input equals the calling %Buffer instance, @n
* else @c false
- * @param[in] obj The object to compare with the current %Buffer instance
- * @remarks This method returns @c true if and only if the specified object is also an instance of %Buffer,
+ * @param[in] obj The object to compare with the calling %Buffer
+ * @remarks This method returns @c true if and only if the specified object is also an instance of %Buffer class,
* the two buffers have the same number of remaining elements, and the two sequences of
- * remaining elements are equal (considered independent of their starting positions).
+ * remaining elements are equal (considered independently of their starting positions).
* @see Tizen::Base::BufferBase::GetHashCode()
*/
virtual bool Equals(const Tizen::Base::Object& obj) const
*
* @since 2.0
*
- * @return The hash value of the current instance
+ * @return The hash value of the current instance
* @remarks The hash code of a buffer depends only upon its remaining elements.
*/
virtual int GetHashCode(void) const