diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-07-08 10:38:38 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-07-08 10:38:38 -0600 |
commit | fe17067d6a30b85a0346fd1ccb2b95e2081e6962 (patch) | |
tree | e37d94ca816b35e5015515b7efb86968a9270bba /components/script/dom/bindings/codegen/Nullable.h | |
parent | 805232a85e401f1a07635da894c8e7d05fed4ce9 (diff) | |
parent | 1ce089abf47e9aa62e862c9e1d875727c4297c07 (diff) | |
download | servo-fe17067d6a30b85a0346fd1ccb2b95e2081e6962.tar.gz servo-fe17067d6a30b85a0346fd1ccb2b95e2081e6962.zip |
Auto merge of #6581 - frewsxcv:rm-unused-codegen-files, r=Ms2ger
Remove unused files in 'script/dom/bindings/'
As per this conversation:
https://github.com/servo/servo/pull/6580
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6581)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/bindings/codegen/Nullable.h')
-rw-r--r-- | components/script/dom/bindings/codegen/Nullable.h | 68 |
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 */ |