X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=inc%2FFBaseBuffer.h;h=f5eb717e86d7f9b3207de77f6c52a99c8c60d18b;hb=b54953ec1a6df32b1f10ce54ec189c9a3ad826b0;hp=9b2b194913367061d4c2d2d88ff43dfcff724ba1;hpb=84ae32fc9014edf1457554db60000885285034ff;p=platform%2Fframework%2Fnative%2Fappfw.git
diff --git a/inc/FBaseBuffer.h b/inc/FBaseBuffer.h
index 9b2b194..f5eb717 100644
--- a/inc/FBaseBuffer.h
+++ b/inc/FBaseBuffer.h
@@ -1,5 +1,4 @@
//
-// Open Service Platform
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
@@ -19,9 +18,8 @@
* @file FBaseBuffer.h
* @brief This is the header file for the %Buffer class.
*
- * This header file contains the declarations of the %Buffer classes.
+ * This header file contains the declarations of the %Buffer class.
*/
-
#ifndef _FBASE_BUFFER_H_
#define _FBASE_BUFFER_H_
@@ -44,7 +42,7 @@ class ByteBuffer;
*
* 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 Buffer.
*
* @see Tizen::Base::BufferBase
@@ -52,11 +50,11 @@ class ByteBuffer;
* The following example demonstrates how to use the %Buffer class.
*
* @code
- *
+ *
* #include
*
* using namespace Tizen::Base;
- *
+ *
* void
* MyClass::BufferSample(void)
* {
@@ -68,7 +66,7 @@ class ByteBuffer;
* intBuf.Construct(BUFFER_SIZE_MAX);
*
* int intArray[] = {0,1,2,3,4,5,6,7,8,9};
- *
+ *
* // Copies all values from intArray to intBuffer instance
* // position = 10 (num of element copied)
* intBuf.SetArray(intArray, 0, (sizeof(intArray) / sizeof(int)));
@@ -76,58 +74,56 @@ class ByteBuffer;
* // Flips the buffer: The limit is set to the current position and
* // then the position is set to zero
* intBuf.Flip(); // position = 0, limit = 10
- *
+ *
* // Gets the number of elements between the current position and the limit
* int remaining = intBuf.GetRemaining();
- *
+ *
* // Initializes a doubleBuf with capacity(10) using Construct() method
* DoubleBuffer doubleBuf;
* doubleBuf.Construct(remaining);
- *
+ *
* // Reads and writes elements from the intBuf to the doubleBuf
* for (int i = 0; i < remaining; i++)
* {
* int value;
*
* // Demonstrates relative reading and writing
- *
+ *
* // Reads the value at the current position, and then increments the position
* intBuf.Get(value);
- *
+ *
* // Writes the value * 12.34 at the current position of the doubleBuf
* // and then increment the position
* doubleBuf.Set(value * 12.34);
- *
+ *
* // Now, positions of the intBuf and the doubleBuf have been incremented by one
* }
- *
+ *
* // Flips the doubleBuf
* doubleBuf.Flip();
* // Now, the doubleBuf's position = 0 and limit = 10
- *
+ *
* // Gets the remaining elements of the doubleBuf
* remaining = doubleBuf.GetRemaining();
- *
+ *
* // Gets the second double value with index
* double doubleValue;
* doubleBuf.Get(1, doubleValue); // 12.34
* }
- *
+ *
* @endcode
*/
-template
+template< class Type >
class _OSP_EXPORT_ Buffer
: public BufferBase
{
public:
/**
- * This is the default constructor for this class.
- *
- * @since 2.0
+ * 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.
*
- * @remarks After creating an instance of the %Buffer class, one of the Construct() methods must be called explicitly to initialize this instance.
- * @see Construct()
+ * @since 2.0
*/
Buffer(void)
{
@@ -152,13 +148,14 @@ public:
*
* @since 2.0
*
- * @param[in] buffer The other %Buffer instance
+ * @param[in] buffer The other %Buffer instance
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG The specified input parameter is invalid, or
- * the source buffer is not constructed.
+ * @exception E_INVALID_ARG Either of the following conditions has occured:
+ * - The specified input parameter is invalid.
+ * - The source buffer has not been constructed.
* @see Buffer()
*/
- result Construct(const Buffer & buffer)
+ result Construct(const Buffer< Type >& buffer)
{
TryReturn(null != buffer._pData, E_INVALID_ARG, ("[E_INVALID_ARG] The source buffer is not constructed."));
@@ -180,7 +177,7 @@ public:
* @since 2.0
*
* @return An error code
- * @param[in] capacity The number of elements
+ * @param[in] capacity The number of elements
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified @c capacity is negative.
* @see Buffer()
@@ -195,21 +192,24 @@ public:
*
* @since 2.0
*
- * @return An error code
- * @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 a limit of this instance.
- * @param[in] capacity The capacity of this instance
- * @exception E_SUCCESS The method is successful.
- * @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.
+ * @return An error code
+ * @param[in] pBuffer The shared buffer
+ * @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] 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.
*/
result Construct(const Type* pBuffer, int index, int length, int capacity)
{
TryReturn(pBuffer != null, E_INVALID_ARG, "[E_INVALID_ARG] The pBuffer is null.");
- TryReturn(index >= 0 && length >= 0 && capacity >=0, E_OUT_OF_RANGE,
+ TryReturn(index >= 0 && length >= 0 && capacity >= 0, E_OUT_OF_RANGE,
"[E_OUT_OF_RANGE] index(%d), length(%d) and capacity(%d) MUST be greater than or equal to 0.", index,
length, capacity);
TryReturn(index < capacity && length <= capacity && index + length <= capacity, E_OUT_OF_RANGE,
@@ -219,14 +219,14 @@ public:
void* pTemp = null;
int sizeofBufferData = sizeof(_BufferData);
- Type* tempByte = const_cast (pBuffer + index);
- __pArrayStart = reinterpret_cast (tempByte);
+ Type* tempByte = const_cast< Type* >(pBuffer + index);
+ __pArrayStart = reinterpret_cast< byte* >(tempByte);
pTemp = malloc(sizeofBufferData);
TryReturn(pTemp != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY]");
memset(pTemp, 0, sizeofBufferData);
- _pData = static_cast <_BufferData*>(pTemp);
+ _pData = static_cast< _BufferData* >(pTemp);
_pData->refCount = 1;
_pData->capacityInByte = capacity * sizeof(Type);
@@ -238,7 +238,7 @@ public:
}
/**
- * This subscript operator returns the reference to the element indicated by the given @c index.
+ * Returns a reference to the element indicated by the given @c index.
*
* @since 2.0
*
@@ -255,18 +255,18 @@ public:
}
/**
- * Overloaded equality operator to compare two %Buffer instances.
+ * Checks whether two %Buffer instances are equal.
*
* @since 2.0
*
- * @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
+ * @return @c true if the two %Buffer instances 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 two sequences of remaining elements are equal (considered independently of their starting positions).
- * @see Equals()
+ * and the sequences of the remaining elements are equal (considered independent of their starting positions).
+ * @see Equals()
*/
- bool operator ==(const Buffer & buffer) const
+ bool operator ==(const Buffer< Type >& buffer) const
{
bool r = true;
if (this == (void*) (&buffer))
@@ -291,19 +291,19 @@ public:
}
/**
- * Checks whether the two %Buffer instances are not equal.
+ * Checks whether two %Buffer instances are not equal.
*
* @since 2.0
*
- * @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 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()
+ * @return @c true if the two %Buffer instances 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).
+ * @see Equals()
*/
- bool operator !=(const Buffer & buffer) const
+ bool operator !=(const Buffer< Type >& buffer) const
{
return !(*this == buffer);
}
@@ -311,29 +311,30 @@ public:
/**
* Copies the remaining elements of the input %Buffer instance into the current
* %Buffer instance. @n
- * It returns E_OVERFLOW if the remaining part of the current instance is smaller
+ * It returns @c 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 The specified input parameter is invalid, or
- * the source buffer is same as destination buffer,
+ * @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,
* that is, the current instance of %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
+ * @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.
+ * @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. 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 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 following example demonstrates how to use the %CopyFrom() method.
*
@@ -384,15 +385,15 @@ public:
* }
* @endcode
*/
- result CopyFrom(Buffer& buffer)
+ result CopyFrom(Buffer< Type >& buffer)
{
- TryReturn(this != static_cast (&buffer), E_INVALID_ARG,
+ TryReturn(this != static_cast< void* >(&buffer), E_INVALID_ARG,
"[E_INVALID_ARG] The source and target buffers are identical.");
int copyLength = buffer.GetRemaining();
TryReturn(GetRemaining() >= copyLength, E_OVERFLOW, "[E_OVERFLOW]");
memcpy(__pArrayStart + _position * sizeof(Type), buffer.__pArrayStart + buffer._position * sizeof(Type),
- copyLength * sizeof(Type));
+ copyLength * sizeof(Type));
_position += copyLength;
buffer._position += copyLength;
@@ -401,17 +402,18 @@ public:
}
/**
- * Reads the value from the current position in the buffer, and then increments the position. @n
- * Provides a way for relative indexing and reading.
+ * 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.
*
* @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 The operation (arithmetic/casting/conversion) has caused an underflow. @n
- * The current position is greater than the limit.
- * @see Set()
+ * @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.
+ * @see Set()
*/
result Get(Type& value)
{
@@ -423,17 +425,19 @@ public:
/**
* Reads the value at the given @c index. @n
- * Provides a way for absolute indexing and reading.
+ * Provides a way to preform absolute indexing and reading.
*
* @since 2.0
*
* @return An error code
- * @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()
+ * @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.
+ * @see Set()
*/
result Get(int index, Type& value) const
{
@@ -447,21 +451,24 @@ public:
/**
- * Copies the specified range of values from the calling buffer to the specified destination array as per the given @c index of the array.
+ * Copies the specified range of values from the calling buffer to the specified @c index of the destination array.
*
* @since 2.0
*
* @return An error code
- * @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
+ * @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
* @exception E_SUCCESS The method is successful.
- * @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.
+ * @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.
* @see SetArray()
*/
@@ -480,26 +487,27 @@ public:
/**
* 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 from the input buffer,
- * 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 of the input buffer,
+ * then 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.
- * @exception E_SUCCESS The method is successful.
- * @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
+ * @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.
+ * @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
* 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 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()
+ * 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.
*
* The following example demonstrates how to use the %ReadFrom() method.
*
@@ -557,15 +565,15 @@ public:
* }
* @endcode
*/
- result ReadFrom(Buffer& buffer)
+ result ReadFrom(Buffer< Type >& buffer)
{
- TryReturn(this != static_cast (&buffer), E_INVALID_ARG,
+ TryReturn(this != static_cast< void* >(&buffer), E_INVALID_ARG,
"[E_INVALID_ARG] The source and target buffers are identical.");
int copyLength = (GetRemaining() < buffer.GetRemaining()) ? GetRemaining() : buffer.GetRemaining();
memcpy(__pArrayStart + _position * sizeof(Type), buffer.__pArrayStart + buffer._position * sizeof(Type),
- copyLength * sizeof(Type));
+ copyLength * sizeof(Type));
_position += copyLength;
buffer._position += copyLength;
@@ -577,15 +585,16 @@ public:
/**
* Writes the specified @c value into the current buffer instance at the current position,
* and then increments the position. @n
- * Provides a way for relative indexing and writing.
+ * Provides a way to perform relative indexing and writing.
*
- * @since 2.0
+ * @since 2.0
*
* @return An error code
- * @param[in] value The value to write to the calling %Buffer
+ * @param[in] value The value to write into the calling %Buffer
* @exception E_SUCCESS The method is successful.
- * @exception E_OVERFLOW The operation (arithmetic/casting/conversion) has caused an overflow. @n
- * The current position is not smaller than the limit.
+ * @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.
* @see Get()
*/
result Set(Type value)
@@ -597,17 +606,19 @@ public:
}
/**
- * 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.
+ * 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.
*
* @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
- * @exception E_SUCCESS The method is successful.
- * @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.
+ * @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.
* @see Get()
*/
result Set(int index, Type value)
@@ -626,19 +637,21 @@ public:
* @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 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.
+ * @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
* After the copy operation, the position is incremented by @c length.
* @see GetArray()
*/
@@ -658,19 +671,19 @@ public:
/**
* Creates a new %Buffer instance. @n
* Its content is a shared portion of
- * the calling %Buffer instance that starts from the current position of calling %Buffer instance.
+ * the calling %Buffer instance that starts from the current position of the calling %Buffer instance.
*
* @since 2.0
*
- * @return A pointer to the new buffer
- * @remarks The content of the new buffer starts at the current position of this instance of %Buffer.
+ * @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
* 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.
*/
- Buffer * SliceN(void) const
+ Buffer< Type >* SliceN(void) const
{
- Buffer * pBuffer = new Buffer ();
+ Buffer< Type >* pBuffer = new Buffer< Type >();
pBuffer->_pData = _pData;
AddRef();
pBuffer->_capacity = GetRemaining();
@@ -697,22 +710,22 @@ public:
}
/**
- * Compares the Object instance with the calling %Buffer instance for equivalence.
+ * Compares the Object instance with the current %Buffer instance for equality.
*
* @since 2.0
*
- * @return @c true if the input equals the calling %Buffer instance, @n
+ * @return @c true if the input equals the current %Buffer instance, @n
* else @c false
- * @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,
+ * @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,
* the two buffers have the same number of remaining elements, and the two sequences of
- * remaining elements are equal (considered independently of their starting positions).
+ * remaining elements are equal (considered independent of their starting positions).
* @see Tizen::Base::BufferBase::GetHashCode()
*/
virtual bool Equals(const Tizen::Base::Object& obj) const
{
bool out = false;
- const Buffer * other = static_cast *>(&obj);
+ const Buffer< Type >* other = static_cast< const Buffer< Type >* >(&obj);
if ((other == this) || (*other == *this))
{
out = true;
@@ -726,8 +739,8 @@ public:
*
* @since 2.0
*
- * @return The hash value of the current instance
- * @remarks The hash code of a buffer depends only upon its remaining elements.
+ * @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
{
@@ -737,7 +750,7 @@ public:
int offset = _position * GetTypeSize();
for (int i = 0; i < len; ++i)
{
- hash = (hash<<5) - hash + (int) __pArrayStart[offset + (i * sizeof(int))];
+ hash = (hash << 5) - hash + (int) __pArrayStart[offset + (i * sizeof(int))];
}
return hash;
@@ -747,7 +760,7 @@ private:
/**
* This is the copy constructor for this class.
*/
- Buffer(const Buffer & buffer)
+ Buffer(const Buffer< Type >& buffer)
{
Construct(buffer);
}
@@ -755,7 +768,7 @@ private:
/**
* This is the assignment operator.
*/
- Buffer & operator =(const Buffer & buffer);
+ Buffer< Type >& operator =(const Buffer< Type >& buffer);
/**
* Returns the size of the type of this buffer.
@@ -773,56 +786,56 @@ private:
/**
- * The @c double buffer type.
+ * The @c double buffer type
* @since 2.0
*/
-typedef Buffer DoubleBuffer;
+typedef Buffer< double > DoubleBuffer;
/**
-* The @c float buffer type.
+* The @c float buffer type
* @since 2.0
*/
-typedef Buffer FloatBuffer;
+typedef Buffer< float > FloatBuffer;
/**
-* The @c int buffer type.
+* The @c int buffer type
* @since 2.0
*/
-typedef Buffer IntBuffer;
+typedef Buffer< int > IntBuffer;
/**
-* The @c long buffer type.
+* The @c long buffer type
* @since 2.0
*/
-typedef Buffer LongBuffer;
+typedef Buffer< long > LongBuffer;
/**
-* The @c long @c long buffer type.
+* The @c long @c long buffer type
* @since 2.0
*/
-typedef Buffer LongLongBuffer;
+typedef Buffer< long long > LongLongBuffer;
/**
-* The @c wchar_t buffer type.
+* The @c wchar_t buffer type
* @since 2.0
*/
-typedef Buffer WcharBuffer;
+typedef Buffer< wchar_t > WcharBuffer;
/**
-* The @c short buffer type.
+* The @c short buffer type
* @since 2.0
*/
-typedef Buffer ShortBuffer;
+typedef Buffer< short > ShortBuffer;
#ifdef _MSC_VER
-template class _OSP_EXPORT_ Buffer ;
-template class _OSP_EXPORT_ Buffer ;
-template class _OSP_EXPORT_ Buffer ;
-template class _OSP_EXPORT_ Buffer ;
-template class _OSP_EXPORT_ Buffer ;
-template class _OSP_EXPORT_ Buffer ;
-template class _OSP_EXPORT_ Buffer ;
+template class _OSP_EXPORT_ Buffer< double >;
+template class _OSP_EXPORT_ Buffer< float >;
+template class _OSP_EXPORT_ Buffer< int >;
+template class _OSP_EXPORT_ Buffer< long >;
+template class _OSP_EXPORT_ Buffer< long long >;
+template class _OSP_EXPORT_ Buffer< wchar_t >;
+template class _OSP_EXPORT_ Buffer< short >;
#endif
}} // Tizen::Base