Fixed issues, Modified spec to use xbuild, doxygen comments
[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     /// </summary>
16     public class Request : IDisposable
17     {
18         private bool _disposed = false;
19
20         internal Request()
21         {
22         }
23
24         ~Request()
25         {
26             Dispose(false);
27         }
28
29         /// <summary>
30         /// The host address of the request
31         /// </summary>
32         public string HostAddress { get; internal set; }
33
34         /// <summary>
35         /// The representation of the request
36         /// </summary>
37         public Representation Representation { get; internal set; }
38
39         /// <summary>
40         /// The query of the request
41         /// </summary>
42         public ResourceQuery Query { get; internal set; }
43
44         /// <summary>
45         /// The options related to the request
46         /// </summary>
47         public ResourceOptions Options { get; internal set; }
48
49         public void Dispose()
50         {
51             Dispose(true);
52             GC.SuppressFinalize(this);
53         }
54
55         protected virtual void Dispose(bool disposing)
56         {
57             if (_disposed)
58                 return;
59
60             if (disposing)
61             {
62                 Representation?.Dispose();
63                 Query?.Dispose();
64                 Options?.Dispose();
65             }
66
67             _disposed = true;
68         }
69     }
70 }