kodi
Service.h
1 /*****************************************************************
2 |
3 | Platinum - Managed Service
4 |
5 | Copyright (c) 2004-2010, Plutinosoft, LLC.
6 | All rights reserved.
7 | http://www.plutinosoft.com
8 |
9 | This program is free software; you can redistribute it and/or
10 | modify it under the terms of the GNU General Public License
11 | as published by the Free Software Foundation; either version 2
12 | of the License, or (at your option) any later version.
13 |
14 | OEMs, ISVs, VARs and other distributors that combine and
15 | distribute commercially licensed software with Platinum software
16 | and do not wish to distribute the source code for the commercially
17 | licensed software under version 2, or (at your option) any later
18 | version, of the GNU General Public License (the "GPL") must enter
19 | into a commercial license agreement with Plutinosoft, LLC.
20 |
21 | This program is distributed in the hope that it will be useful,
22 | but WITHOUT ANY WARRANTY; without even the implied warranty of
23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 | GNU General Public License for more details.
25 |
26 | You should have received a copy of the GNU General Public License
27 | along with this program; see the file LICENSE.txt. If not, write to
28 | the Free Software Foundation, Inc.,
29 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
30 | http://www.gnu.org/licenses/gpl-2.0.html
31 |
32 ****************************************************************/
33 #pragma once
34 
35 namespace Platinum
36 {
37 
38 ref class DeviceData;
39 ref class ActionDescription;
40 ref class StateVariable;
41 
42 /*----------------------------------------------------------------------
43 | Service
44 +---------------------------------------------------------------------*/
45 public ref class Service
46 {
47 private:
48 
49  PLT_Service* m_pHandle;
50 
51 internal:
52 
53  property PLT_Service& Handle
54  {
55  PLT_Service& get()
56  {
57  return *m_pHandle;
58  }
59  }
60 
61 public:
62 
63  property Uri^ SCPDURL
64  {
65  Uri^ get()
66  {
67  return marshal_as<Uri^>(m_pHandle->GetSCPDURL());
68  }
69  }
70 
71  property String^ ServiceID
72  {
73  String^ get()
74  {
75  return gcnew String(m_pHandle->GetServiceID());
76  }
77  }
78 
79  property String^ ServiceType
80  {
81  String^ get()
82  {
83  return gcnew String(m_pHandle->GetServiceType());
84  }
85  }
86 
87  property DeviceData^ ParentDevice
88  {
89  DeviceData^ get();
90  }
91 
92  property IEnumerable<StateVariable^>^ StateVariables
93  {
94  IEnumerable<StateVariable^>^ get();
95  }
96 
97  property IEnumerable<ActionDescription^>^ Actions
98  {
99  IEnumerable<ActionDescription^>^ get();
100  }
101 
102 public:
103 
104  ActionDescription^ FindAction(String^ name);
105  StateVariable^ FindStateVariable(String^ name);
106 
107 public:
108 
109  virtual Boolean Equals(Object^ obj) override
110  {
111  if (obj == nullptr)
112  return false;
113 
114  if (!this->GetType()->IsInstanceOfType(obj))
115  return false;
116 
117  return (m_pHandle == ((Service^)obj)->m_pHandle);
118  }
119 
120 internal:
121 
122  Service(PLT_Service& devData)
123  {
124  m_pHandle = &devData;
125  }
126 
127 public:
128 
129  ~Service()
130  {
131  // clean-up managed
132 
133  // clean-up unmanaged
134  this->!Service();
135  }
136 
137  !Service()
138  {
139  // clean-up unmanaged
140  }
141 
142 };
143 
144 }
145 
146 // marshal wrapper
147 PLATINUM_MANAGED_MARSHAL_AS(Platinum::Service, PLT_Service);
Definition: DeviceData.h:88
Definition: Service.h:45
Definition: ActionDescription.h:44
UPnP Service.
Definition: PltService.h:67
Definition: StateVariable.h:43
const NPT_String & GetServiceType() const
Return the service type.
Definition: PltService.h:171
NPT_String GetSCPDURL(bool absolute=false)
Return the SCPD url associated with this service.
Definition: PltService.cpp:371
const NPT_String & GetServiceID() const
Return the service id.
Definition: PltService.h:165