Romain Guy | c5cbee7 | 2013-03-20 19:15:02 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef ANDROID_HWUI_PAIR_H |
| 18 | #define ANDROID_HWUI_PAIR_H |
| 19 | |
| 20 | namespace android { |
| 21 | namespace uirenderer { |
| 22 | |
| 23 | template <typename F, typename S> |
| 24 | struct Pair { |
| 25 | F first; |
| 26 | S second; |
| 27 | |
| 28 | Pair() { } |
| 29 | Pair(const Pair& o) : first(o.first), second(o.second) { } |
| 30 | Pair(const F& f, const S& s) : first(f), second(s) { } |
| 31 | |
| 32 | inline const F& getFirst() const { |
| 33 | return first; |
| 34 | } |
| 35 | |
| 36 | inline const S& getSecond() const { |
| 37 | return second; |
| 38 | } |
| 39 | }; |
| 40 | |
| 41 | }; // namespace uirenderer |
| 42 | |
| 43 | template <typename F, typename S> |
| 44 | struct trait_trivial_ctor< uirenderer::Pair<F, S> > |
| 45 | { enum { value = aggregate_traits<F, S>::has_trivial_ctor }; }; |
| 46 | template <typename F, typename S> |
| 47 | struct trait_trivial_dtor< uirenderer::Pair<F, S> > |
| 48 | { enum { value = aggregate_traits<F, S>::has_trivial_dtor }; }; |
| 49 | template <typename F, typename S> |
| 50 | struct trait_trivial_copy< uirenderer::Pair<F, S> > |
| 51 | { enum { value = aggregate_traits<F, S>::has_trivial_copy }; }; |
| 52 | template <typename F, typename S> |
| 53 | struct trait_trivial_move< uirenderer::Pair<F, S> > |
| 54 | { enum { value = aggregate_traits<F, S>::has_trivial_move }; }; |
| 55 | |
| 56 | }; // namespace android |
| 57 | |
| 58 | #endif // ANDROID_HWUI_PAIR_H |