Merge "Added Doxygen comments, incorporated recent CAPI changes" into devel
[platform/core/csapi/tizenfx.git] / src / Tizen.Network.IoTConnectivity / Tizen.Network.IoTConnectivity / Request.cs
1 /// Copyright 2016 by Samsung Electronics, Inc.,
2 ///
3 /// This software is the confidential and proprietary information
4 /// of Samsung Electronics, Inc. ("Confidential Information"). You
5 /// shall not disclose such Confidential Information and shall use
6 /// it only in accordance with the terms of the license agreement
7 /// you entered into with Samsung.
8
9 using System;
10
11 namespace Tizen.Network.IoTConnectivity
12 {
13     /// <summary>
14     /// Class respresenting request to a resource.
15     /// It provides APIs to manage client's request.
16     /// </summary>
17     public class Request : IDisposable
18     {
19         private bool _disposed = false;
20
21         internal Request()
22         {
23         }
24
25         /// <summary>
26         /// Destructor of the Request class.
27         /// </summary>
28         ~Request()
29         {
30             Dispose(false);
31         }
32
33         /// <summary>
34         /// The host address of the request
35         /// </summary>
36         public string HostAddress { get; internal set; }
37
38         /// <summary>
39         /// The representation of the request
40         /// </summary>
41         public Representation Representation { get; internal set; }
42
43         /// <summary>
44         /// The query of the request
45         /// </summary>
46         public ResourceQuery Query { get; internal set; }
47
48         /// <summary>
49         /// The options related to the request
50         /// </summary>
51         public ResourceOptions Options { get; internal set; }
52
53         /// <summary>
54         /// Releases any unmanaged resources used by this object.
55         /// </summary>
56         public void Dispose()
57         {
58             Dispose(true);
59             GC.SuppressFinalize(this);
60         }
61
62         /// <summary>
63         /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
64         /// </summary>
65         /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
66         protected virtual void Dispose(bool disposing)
67         {
68             if (_disposed)
69                 return;
70
71             if (disposing)
72             {
73                 Representation?.Dispose();
74                 Query?.Dispose();
75                 Options?.Dispose();
76             }
77
78             _disposed = true;
79         }
80     }
81 }