blob: 9bcebd9afc8002445b64d63680a81ad18e56b912 [file] [log] [blame]
Jorge E. Moreira4b9bbb12017-12-28 15:49:06 -08001/*
2 * Copyright (C) 2016 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#include "common/vsoc/lib/e2e_test_region_view.h"
18
19namespace vsoc {
20
21#if defined(CUTTLEFISH_HOST)
22std::shared_ptr<E2EPrimaryRegionView> E2EPrimaryRegionView::GetInstance(
23 const char* domain) {
24 return vsoc::RegionView::GetInstanceImpl<E2EPrimaryRegionView>(
25 [](std::shared_ptr<E2EPrimaryRegionView> region, const char* domain) {
26 return region->Open(domain);
27 },
28 domain);
29}
30#else
31std::shared_ptr<E2EPrimaryRegionView> E2EPrimaryRegionView::GetInstance() {
32 return vsoc::RegionView::GetInstanceImpl<E2EPrimaryRegionView>(
33 std::mem_fn(&E2EPrimaryRegionView::Open));
34}
35#endif
36
37#if defined(CUTTLEFISH_HOST)
38std::shared_ptr<E2ESecondaryRegionView> E2ESecondaryRegionView::GetInstance(
39 const char* domain) {
40 return vsoc::RegionView::GetInstanceImpl<E2ESecondaryRegionView>(
41 [](std::shared_ptr<E2ESecondaryRegionView> region, const char* domain) {
42 return region->Open(domain);
43 },
44 domain);
45}
46#else
47std::shared_ptr<E2ESecondaryRegionView> E2ESecondaryRegionView::GetInstance() {
48 return vsoc::RegionView::GetInstanceImpl<E2ESecondaryRegionView>(
49 std::mem_fn(&E2ESecondaryRegionView::Open));
50}
51#endif
52
53#if defined(CUTTLEFISH_HOST)
54std::shared_ptr<E2EUnfindableRegionView> E2EUnfindableRegionView::GetInstance(
55 const char* domain) {
56 return vsoc::RegionView::GetInstanceImpl<E2EUnfindableRegionView>(
57 [](std::shared_ptr<E2EUnfindableRegionView> region, const char* domain) {
58 return region->Open(domain);
59 },
60 domain);
61}
62#else
63std::shared_ptr<E2EUnfindableRegionView>
64E2EUnfindableRegionView::GetInstance() {
65 return vsoc::RegionView::GetInstanceImpl<E2EUnfindableRegionView>(
66 std::mem_fn(&E2EUnfindableRegionView::Open));
67}
68#endif
69
70} // namespace vsoc