aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/Nullable.h
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2015-07-09 07:09:52 +0900
committerCorey Farwell <coreyf@rwell.org>2015-07-09 07:25:14 +0900
commit1ce089abf47e9aa62e862c9e1d875727c4297c07 (patch)
treee37d94ca816b35e5015515b7efb86968a9270bba /components/script/dom/bindings/codegen/Nullable.h
parent805232a85e401f1a07635da894c8e7d05fed4ce9 (diff)
downloadservo-1ce089abf47e9aa62e862c9e1d875727c4297c07.tar.gz
servo-1ce089abf47e9aa62e862c9e1d875727c4297c07.zip
Remove unused files in 'script/dom/bindings/'
As per this conversation: https://github.com/servo/servo/pull/6580
Diffstat (limited to 'components/script/dom/bindings/codegen/Nullable.h')
-rw-r--r--components/script/dom/bindings/codegen/Nullable.h68
1 files changed, 0 insertions, 68 deletions
diff --git a/components/script/dom/bindings/codegen/Nullable.h b/components/script/dom/bindings/codegen/Nullable.h
deleted file mode 100644
index 8b2cc08642b..00000000000
--- a/components/script/dom/bindings/codegen/Nullable.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
-/* vim: set ts=2 sw=2 et tw=79: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_Nullable_h
-#define mozilla_dom_Nullable_h
-
-#include "mozilla/Assertions.h"
-
-namespace mozilla {
-namespace dom {
-
-// Support for nullable types
-template <typename T>
-struct Nullable
-{
-private:
- T mValue;
- bool mIsNull;
-
-public:
- Nullable()
- : mIsNull(true)
- {}
-
- Nullable(T aValue)
- : mValue(aValue)
- , mIsNull(false)
- {}
-
- void SetValue(T aValue) {
- mValue = aValue;
- mIsNull = false;
- }
-
- // For cases when |T| is some type with nontrivial copy behavior, we may want
- // to get a reference to our internal copy of T and work with it directly
- // instead of relying on the copying version of SetValue().
- T& SetValue() {
- mIsNull = false;
- return mValue;
- }
-
- void SetNull() {
- mIsNull = true;
- }
-
- const T& Value() const {
- MOZ_ASSERT(!mIsNull);
- return mValue;
- }
-
- T& Value() {
- MOZ_ASSERT(!mIsNull);
- return mValue;
- }
-
- bool IsNull() const {
- return mIsNull;
- }
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif /* mozilla_dom_Nullable_h */