Bumping manifests a=b2g-bump
[gecko.git] / xpcom / ds / nsSupportsPrimitives.h
blobcff4ea2eeff1dc82474835e7be348b598c5a1f75
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsSupportsPrimitives_h__
7 #define nsSupportsPrimitives_h__
9 #include "mozilla/Attributes.h"
11 #include "nsISupportsPrimitives.h"
12 #include "nsCOMPtr.h"
13 #include "nsString.h"
15 class nsSupportsIDImpl MOZ_FINAL : public nsISupportsID
17 public:
18 NS_DECL_ISUPPORTS
19 NS_DECL_NSISUPPORTSPRIMITIVE
20 NS_DECL_NSISUPPORTSID
22 nsSupportsIDImpl();
24 private:
25 ~nsSupportsIDImpl() {}
27 nsID* mData;
30 /***************************************************************************/
32 class nsSupportsCStringImpl MOZ_FINAL : public nsISupportsCString
34 public:
35 NS_DECL_ISUPPORTS
36 NS_DECL_NSISUPPORTSPRIMITIVE
37 NS_DECL_NSISUPPORTSCSTRING
39 nsSupportsCStringImpl() {}
41 private:
42 ~nsSupportsCStringImpl() {}
44 nsCString mData;
47 /***************************************************************************/
49 class nsSupportsStringImpl MOZ_FINAL : public nsISupportsString
51 public:
52 NS_DECL_ISUPPORTS
53 NS_DECL_NSISUPPORTSPRIMITIVE
54 NS_DECL_NSISUPPORTSSTRING
56 nsSupportsStringImpl() {}
58 private:
59 ~nsSupportsStringImpl() {}
61 nsString mData;
64 /***************************************************************************/
66 class nsSupportsPRBoolImpl MOZ_FINAL : public nsISupportsPRBool
68 public:
69 NS_DECL_THREADSAFE_ISUPPORTS
70 NS_DECL_NSISUPPORTSPRIMITIVE
71 NS_DECL_NSISUPPORTSPRBOOL
73 nsSupportsPRBoolImpl();
75 private:
76 ~nsSupportsPRBoolImpl() {}
78 bool mData;
81 /***************************************************************************/
83 class nsSupportsPRUint8Impl MOZ_FINAL : public nsISupportsPRUint8
85 public:
86 NS_DECL_ISUPPORTS
87 NS_DECL_NSISUPPORTSPRIMITIVE
88 NS_DECL_NSISUPPORTSPRUINT8
90 nsSupportsPRUint8Impl();
92 private:
93 ~nsSupportsPRUint8Impl() {}
95 uint8_t mData;
98 /***************************************************************************/
100 class nsSupportsPRUint16Impl MOZ_FINAL : public nsISupportsPRUint16
102 public:
103 NS_DECL_ISUPPORTS
104 NS_DECL_NSISUPPORTSPRIMITIVE
105 NS_DECL_NSISUPPORTSPRUINT16
107 nsSupportsPRUint16Impl();
109 private:
110 ~nsSupportsPRUint16Impl() {}
112 uint16_t mData;
115 /***************************************************************************/
117 class nsSupportsPRUint32Impl MOZ_FINAL : public nsISupportsPRUint32
119 public:
120 NS_DECL_ISUPPORTS
121 NS_DECL_NSISUPPORTSPRIMITIVE
122 NS_DECL_NSISUPPORTSPRUINT32
124 nsSupportsPRUint32Impl();
126 private:
127 ~nsSupportsPRUint32Impl() {}
129 uint32_t mData;
132 /***************************************************************************/
134 class nsSupportsPRUint64Impl MOZ_FINAL : public nsISupportsPRUint64
136 public:
137 NS_DECL_ISUPPORTS
138 NS_DECL_NSISUPPORTSPRIMITIVE
139 NS_DECL_NSISUPPORTSPRUINT64
141 nsSupportsPRUint64Impl();
143 private:
144 ~nsSupportsPRUint64Impl() {}
146 uint64_t mData;
149 /***************************************************************************/
151 class nsSupportsPRTimeImpl MOZ_FINAL : public nsISupportsPRTime
153 public:
154 NS_DECL_ISUPPORTS
155 NS_DECL_NSISUPPORTSPRIMITIVE
156 NS_DECL_NSISUPPORTSPRTIME
158 nsSupportsPRTimeImpl();
160 private:
161 ~nsSupportsPRTimeImpl() {}
163 PRTime mData;
166 /***************************************************************************/
168 class nsSupportsCharImpl MOZ_FINAL : public nsISupportsChar
170 public:
171 NS_DECL_ISUPPORTS
172 NS_DECL_NSISUPPORTSPRIMITIVE
173 NS_DECL_NSISUPPORTSCHAR
175 nsSupportsCharImpl();
177 private:
178 ~nsSupportsCharImpl() {}
180 char mData;
183 /***************************************************************************/
185 class nsSupportsPRInt16Impl MOZ_FINAL : public nsISupportsPRInt16
187 public:
188 NS_DECL_ISUPPORTS
189 NS_DECL_NSISUPPORTSPRIMITIVE
190 NS_DECL_NSISUPPORTSPRINT16
192 nsSupportsPRInt16Impl();
194 private:
195 ~nsSupportsPRInt16Impl() {}
197 int16_t mData;
200 /***************************************************************************/
202 class nsSupportsPRInt32Impl MOZ_FINAL : public nsISupportsPRInt32
204 public:
205 NS_DECL_ISUPPORTS
206 NS_DECL_NSISUPPORTSPRIMITIVE
207 NS_DECL_NSISUPPORTSPRINT32
209 nsSupportsPRInt32Impl();
211 private:
212 ~nsSupportsPRInt32Impl() {}
214 int32_t mData;
217 /***************************************************************************/
219 class nsSupportsPRInt64Impl MOZ_FINAL : public nsISupportsPRInt64
221 public:
222 NS_DECL_ISUPPORTS
223 NS_DECL_NSISUPPORTSPRIMITIVE
224 NS_DECL_NSISUPPORTSPRINT64
226 nsSupportsPRInt64Impl();
228 private:
229 ~nsSupportsPRInt64Impl() {}
231 int64_t mData;
234 /***************************************************************************/
236 class nsSupportsFloatImpl MOZ_FINAL : public nsISupportsFloat
238 public:
239 NS_DECL_ISUPPORTS
240 NS_DECL_NSISUPPORTSPRIMITIVE
241 NS_DECL_NSISUPPORTSFLOAT
243 nsSupportsFloatImpl();
245 private:
246 ~nsSupportsFloatImpl() {}
248 float mData;
251 /***************************************************************************/
253 class nsSupportsDoubleImpl MOZ_FINAL : public nsISupportsDouble
255 public:
256 NS_DECL_ISUPPORTS
257 NS_DECL_NSISUPPORTSPRIMITIVE
258 NS_DECL_NSISUPPORTSDOUBLE
260 nsSupportsDoubleImpl();
262 private:
263 ~nsSupportsDoubleImpl() {}
265 double mData;
268 /***************************************************************************/
270 class nsSupportsVoidImpl MOZ_FINAL : public nsISupportsVoid
272 public:
273 NS_DECL_THREADSAFE_ISUPPORTS
274 NS_DECL_NSISUPPORTSPRIMITIVE
275 NS_DECL_NSISUPPORTSVOID
277 nsSupportsVoidImpl();
279 private:
280 ~nsSupportsVoidImpl() {}
282 void* mData;
285 /***************************************************************************/
287 class nsSupportsInterfacePointerImpl MOZ_FINAL : public nsISupportsInterfacePointer
289 public:
290 NS_DECL_THREADSAFE_ISUPPORTS
291 NS_DECL_NSISUPPORTSPRIMITIVE
292 NS_DECL_NSISUPPORTSINTERFACEPOINTER
294 nsSupportsInterfacePointerImpl();
296 private:
297 ~nsSupportsInterfacePointerImpl();
299 nsCOMPtr<nsISupports> mData;
300 nsID* mIID;
303 /***************************************************************************/
306 * Wraps a static const char* buffer for use with nsISupportsCString
308 * Only use this class with static buffers, or arena-allocated buffers of
309 * permanent lifetime!
311 class nsSupportsDependentCString MOZ_FINAL : public nsISupportsCString
313 public:
314 NS_DECL_ISUPPORTS
315 NS_DECL_NSISUPPORTSPRIMITIVE
316 NS_DECL_NSISUPPORTSCSTRING
318 explicit nsSupportsDependentCString(const char* aStr);
320 private:
321 ~nsSupportsDependentCString() {}
323 nsDependentCString mData;
326 #endif /* nsSupportsPrimitives_h__ */