Skip to content

Commit

Permalink
Merge branch 'master' into description
Browse files Browse the repository at this point in the history
  • Loading branch information
hjhun authored Sep 27, 2024
2 parents 40946a0 + 645db63 commit 72509c3
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 105 deletions.
132 changes: 73 additions & 59 deletions src/Tizen.Applications.Common/Tizen.Applications.RPCPort/Parcel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ public class Parcel : IDisposable
private ParcelHeader _header;

/// <summary>
/// Constructor for this class.
/// Constructs a new instance of the Parcel class.
/// </summary>
/// <param name="withHeader">If it's false, the parcel object does not have the header.</param>
/// <exception cref="InvalidIOException">Thrown when an internal IO error occurs.</exception>
/// <param name="withHeader">Determines whether the created parcel object includes a header or not.</param>
/// <exception cref="InvalidIOException">Thrown when an internal I/O error occurs during the construction process.</exception>
/// <since_tizen> 11 </since_tizen>
public Parcel(bool withHeader)
{
Expand Down Expand Up @@ -188,10 +188,10 @@ public Parcel() : this(true)
}

/// <summary>
/// Constructor with port object.
/// Creates a new parcel object from a specified port object.
/// </summary>
/// <param name="port">Port object.</param>
/// <exception cref="InvalidIOException">Thrown when an internal IO error occurs.</exception>
/// <param name="port">The port object to create a parcel from.</param>
/// <exception cref="InvalidIOException">An internal IO error occurred while creating the parcel.</exception>
/// <since_tizen> 5 </since_tizen>
public Parcel(Port port)
{
Expand All @@ -203,10 +203,10 @@ public Parcel(Port port)
}

/// <summary>
/// Constructor with the raw bytes.
/// Constructs a new Parcel object from the specified raw bytes.
/// </summary>
/// <param name="bytes">The raw bytes.</param>
/// <exception cref="InvalidIOException">Thrown when an internal IO error occurs.</exception>
/// <param name="bytes">An array of bytes that represents the content of the parcel.</param>
/// <exception cref="InvalidOperationException">Thrown if an invalid argument is passed in or an internal I/O error occurs.</exception>
/// <since_tizen> 9 </since_tizen>
public Parcel(byte[] bytes)
{
Expand All @@ -218,10 +218,10 @@ public Parcel(byte[] bytes)
}

/// <summary>
/// Gets the raw bytes of the parcel.
/// Converts the current parcel into its raw bytes representation.
/// </summary>
/// <returns>The raw bytes of the parcel.</returns>
/// <exception cref="InvalidIOException">Thrown when an internal IO error occurs.</exception>
/// <returns>An array of bytes containing the contents of the parcel.</returns>
/// <exception cref="InvalidIOException">Thrown if an internal I/O error occurs during conversion.</exception>
/// <since_tizen> 9 </since_tizen>
public byte[] ToBytes()
{
Expand All @@ -234,9 +234,9 @@ public byte[] ToBytes()
}

/// <summary>
/// Sends parcel data through the port.
/// Sends parcel data through the specified port.
/// </summary>
/// <param name="p">The RPC port object for writing data.</param>
/// <param name="port">The RPC port object for writing data.</param>
/// <exception cref="InvalidIOException">Thrown when an internal IO error occurs.</exception>
/// <since_tizen> 5 </since_tizen>
public void Send(Port p)
Expand All @@ -249,9 +249,9 @@ public void Send(Port p)
}

/// <summary>
/// Writes a byte value into parcel object.
/// Writes a single byte value into the parcel object.
/// </summary>
/// <param name="b">byte data.</param>
/// <param name="b">The byte value to be written into the parcel object.</param>
/// <since_tizen> 5 </since_tizen>
public void WriteByte(byte b)
{
Expand All @@ -261,77 +261,91 @@ public void WriteByte(byte b)
/// <summary>
/// Writes a short value into parcel object.
/// </summary>
/// <param name="b">short data.</param>
/// <param name="b">The short data to write.</param>
/// <since_tizen> 5 </since_tizen>
public void WriteShort(short b)
{
Interop.LibRPCPort.Parcel.WriteInt16(_handle, b);
}

/// <summary>
/// Writes an int value into parcel object.
/// </summary>
/// <param name="b">int data.</param>
/// Writes an integer value into the parcel object.
/// </summary>
/// <param name="b">The integer value to write.</param>
/// <example>
/// Here's an example showing how to write an integer value into a parcel object:
///
/// <code>
/// // Create a new parcel object
/// Parcel parcel = new Parcel();
///
/// // Write an integer value into the parcel object
/// parcel.WriteInt(42);
///
/// // Do something else with the parcel object...
/// ...
/// </code>
/// </example>
/// <since_tizen> 5 </since_tizen>
public void WriteInt(int b)
{
Interop.LibRPCPort.Parcel.WriteInt32(_handle, b);
}

/// <summary>
/// Writes a long value into parcel object.
/// Writes a long value into the parcel object.
/// </summary>
/// <param name="b">long data.</param>
/// <param name="b">The long data to write.</param>
/// <since_tizen> 5 </since_tizen>
public void WriteLong(long b)
{
Interop.LibRPCPort.Parcel.WriteInt64(_handle, b);
}

/// <summary>
/// Writes a float value into parcel object.
/// Writes a float value into the parcel object.
/// </summary>
/// <param name="b">float data.</param>
/// <param name="b">The float data to write into the parcel object.</param>
/// <since_tizen> 5 </since_tizen>
public void WriteFloat(float b)
{
Interop.LibRPCPort.Parcel.WriteFloat(_handle, b);
}

/// <summary>
/// Writes a double value into parcel object.
/// Writes a double value into the parcel object.
/// </summary>
/// <param name="b">double data.</param>
/// <param name="b">The double data to write.</param>
/// <since_tizen> 5 </since_tizen>
public void WriteDouble(double b)
{
Interop.LibRPCPort.Parcel.WriteDouble(_handle, b);
}

/// <summary>
/// Writes a string value into parcel object.
/// Writes a string value into the parcel object.
/// </summary>
/// <param name="b">string data.</param>
/// <param name="b">The string data to be written into the parcel object.</param>
/// <since_tizen> 5 </since_tizen>
public void WriteString(string b)
{
Interop.LibRPCPort.Parcel.WriteString(_handle, b);
}

/// <summary>
/// Writes a bool value into parcel object.
/// Writes a boolean value into the parcel object.
/// </summary>
/// <param name="b">bool data.</param>
/// <param name="b">The boolean value to write.</param>
/// <since_tizen> 5 </since_tizen>
public void WriteBool(bool b)
{
Interop.LibRPCPort.Parcel.WriteBool(_handle, b);
}

/// <summary>
/// Writes a Bundle data into parcel object.
/// Writes a Bundle data into the parcel object.
/// </summary>
/// <param name="b">Bundle data.</param>
/// <param name="b">The Bundle object to write.</param>
/// <since_tizen> 5 </since_tizen>
public void WriteBundle(Bundle b)
{
Expand All @@ -344,19 +358,19 @@ public void WriteBundle(Bundle b)
}

/// <summary>
/// Writes a count of an array into parcel object.
/// Writes a count of an array into the parcel object.
/// </summary>
/// <param name="cnt">Array count.</param>
/// <param name="cnt">The number of elements in the array.</param>
/// <since_tizen> 5 </since_tizen>
public void WriteArrayCount(int cnt)
{
Interop.LibRPCPort.Parcel.WriteArrayCount(_handle, cnt);
}

/// <summary>
/// Reads a byte value from parcel object.
/// Reads a byte value from the parcel object.
/// </summary>
/// <returns>byte data.</returns>
/// <returns>The byte value.</returns>
/// <since_tizen> 5 </since_tizen>
public byte ReadByte()
{
Expand All @@ -365,9 +379,9 @@ public byte ReadByte()
}

/// <summary>
/// Reads a short value from parcel object.
/// Reads a short value from the parcel object.
/// </summary>
/// <returns>short data.</returns>
/// <returns>The short data.</returns>
/// <since_tizen> 5 </since_tizen>
public short ReadShort()
{
Expand All @@ -376,9 +390,9 @@ public short ReadShort()
}

/// <summary>
/// Reads an int value from parcel object.
/// Reads an integer value from the parcel object.
/// </summary>
/// <returns>int data.</returns>
/// <returns>The integer data.</returns>
/// <since_tizen> 5 </since_tizen>
public int ReadInt()
{
Expand All @@ -387,9 +401,9 @@ public int ReadInt()
}

/// <summary>
/// Reads a long value from parcel object.
/// Reads a long value from the parcel object.
/// </summary>
/// <returns>long data.</returns>
/// <returns>The long data.</returns>
/// <since_tizen> 5 </since_tizen>
public long ReadLong()
{
Expand All @@ -398,9 +412,9 @@ public long ReadLong()
}

/// <summary>
/// Reads a float value from parcel object.
/// Reads a float value from the parcel object.
/// </summary>
/// <returns>float data.</returns>
/// <returns>The float data.</returns>
/// <since_tizen> 5 </since_tizen>
public float ReadFloat()
{
Expand All @@ -409,9 +423,9 @@ public float ReadFloat()
}

/// <summary>
/// Reads a double value from parcel object.
/// Reads a double value from the parcel object.
/// </summary>
/// <returns>double data.</returns>
/// <returns>The double data.</returns>
/// <since_tizen> 5 </since_tizen>
public double ReadDouble()
{
Expand All @@ -420,9 +434,9 @@ public double ReadDouble()
}

/// <summary>
/// Reads a string value from parcel object.
/// Reads a string value from the parcel object.
/// </summary>
/// <returns>string data.</returns>
/// <returns>The string data.</returns>
/// <since_tizen> 5 </since_tizen>
public string ReadString()
{
Expand All @@ -431,9 +445,9 @@ public string ReadString()
}

/// <summary>
/// Reads a bool value from parcel object.
/// Reads a boolean value from the parcel object.
/// </summary>
/// <returns>bool data.</returns>
/// <returns>The boolean data.</returns>
/// <since_tizen> 5 </since_tizen>
public bool ReadBool()
{
Expand All @@ -442,9 +456,9 @@ public bool ReadBool()
}

/// <summary>
/// Reads a Bundle value from parcel object.
/// Reads a Bundle value from the parcel object.
/// </summary>
/// <returns>Bundle data.</returns>
/// <returns>The Bundle data.</returns>
/// <since_tizen> 5 </since_tizen>
public Bundle ReadBundle()
{
Expand All @@ -460,9 +474,9 @@ public Bundle ReadBundle()
}

/// <summary>
/// Reads a count of an array from parcel object.
/// Reads a count of an array from a parcel object.
/// </summary>
/// <returns>Array count.</returns>
/// <returns>The number of elements in the array.</returns>
/// <since_tizen> 5 </since_tizen>
public int ReadArrayCount()
{
Expand All @@ -471,9 +485,9 @@ public int ReadArrayCount()
}

/// <summary>
/// Writes bytes into parcel object.
/// Writes bytes into the parcel object.
/// </summary>
/// <param name="bytes">Array of bytes.</param>
/// <param name="bytes">An array of bytes containing the data to be written.</param>
/// <since_tizen> 5 </since_tizen>
public void Write(byte[] bytes)
{
Expand All @@ -486,10 +500,10 @@ public void Write(byte[] bytes)
}

/// <summary>
/// Reads bytes from parcel object.
/// Reads bytes from the parcel object.
/// </summary>
/// <param name="size">Bytes to read.</param>
/// <returns>Array of bytes.</returns>
/// <param name="size">The number of bytes to read.</param>
/// <returns>An array of bytes that were read from the parcel.</returns>
/// <since_tizen> 5 </since_tizen>
public byte[] Read(int size)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
namespace Tizen.Applications.RPCPort
{
/// <summary>
/// The class that proxy and stub can use to communicate with each other.
/// A class used by proxies and stubs to communicate with each other.
/// </summary>
/// <since_tizen> 5 </since_tizen>
public class Port
Expand Down
Loading

0 comments on commit 72509c3

Please sign in to comment.