[IoTConnectivity] Added Base implementation
[platform/core/csapi/iotcon.git] / 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         ~Request()
21         {
22             Dispose(false);
23         }
24
25         /// <summary>
26         /// The host address of the request
27         /// </summary>
28         public string HostAddress { get; internal set; }
29
30         /// <summary>
31         /// The representation of the request
32         /// </summary>
33         public Representation Representation { get; internal set; }
34
35         /// <summary>
36         /// The query of the request
37         /// </summary>
38         public ResourceQuery Query { get; internal set; }
39
40         /// <summary>
41         /// The options related to the request
42         /// </summary>
43         public ResourceOptions Options { get; internal set; }
44
45         public void Dispose()
46         {
47             Dispose(true);
48             GC.SuppressFinalize(this);
49         }
50
51         protected virtual void Dispose(bool disposing)
52         {
53             if (_disposed)
54                 return;
55
56             if (disposing)
57             {
58                 Representation.Dispose();
59                 Query.Dispose();
60                 Options.Dispose();
61             }
62
63             _disposed = true;
64         }
65     }
66 }