blob: 172606a4d586e97aa265aeb9cd057fb680d132ed [file] [log] [blame]
Romain Guyc5cbee72013-03-20 19:15:02 -07001/*
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
20namespace android {
21namespace uirenderer {
22
23template <typename F, typename S>
24struct 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
43template <typename F, typename S>
44struct trait_trivial_ctor< uirenderer::Pair<F, S> >
45{ enum { value = aggregate_traits<F, S>::has_trivial_ctor }; };
46template <typename F, typename S>
47struct trait_trivial_dtor< uirenderer::Pair<F, S> >
48{ enum { value = aggregate_traits<F, S>::has_trivial_dtor }; };
49template <typename F, typename S>
50struct trait_trivial_copy< uirenderer::Pair<F, S> >
51{ enum { value = aggregate_traits<F, S>::has_trivial_copy }; };
52template <typename F, typename S>
53struct 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