Open3D (C++ API)  0.18.0+252c867
SlabTraits.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 // Copyright 2019 Saman Ashkiani
9 //
10 // Licensed under the Apache License, Version 2.0 (the "License");
11 // you may not use this file except in compliance with the License.
12 // You may obtain a copy of the License at
13 //
14 // http://www.apache.org/licenses/LICENSE-2.0
15 //
16 // Unless required by applicable law or agreed to in writing, software
17 // distributed under the License is distributed on an "AS IS" BASIS,
18 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
19 // implied. See the License for the specific language governing permissions
20 // and limitations under the License.
21 
22 #pragma once
23 #include <cstdint>
24 
25 #include "open3d/core/CUDAUtils.h"
26 
27 namespace open3d {
28 namespace core {
29 
30 struct iterator_t {
31  OPEN3D_HOST_DEVICE iterator_t() : first(nullptr), second(nullptr) {}
32  OPEN3D_HOST_DEVICE iterator_t(void* key_ptr, void* value_ptr)
33  : first(key_ptr), second(value_ptr) {}
34 
35  void* first;
36  void* second;
37 };
38 
39 template <typename First, typename Second>
40 struct Pair {
41  First first;
42  Second second;
44  OPEN3D_HOST_DEVICE Pair(const First& _first, const Second& _second)
45  : first(_first), second(_second) {}
46 };
47 
48 template <typename First, typename Second>
50  const Second& _second) {
51  return Pair<First, Second>(_first, _second);
52 }
53 
54 } // namespace core
55 } // namespace open3d
Common CUDA utilities.
#define OPEN3D_HOST_DEVICE
Definition: CUDAUtils.h:44
OPEN3D_HOST_DEVICE Pair< First, Second > make_pair(const First &_first, const Second &_second)
Definition: SlabTraits.h:49
Definition: PinholeCameraIntrinsic.cpp:16
Definition: SlabTraits.h:40
Second second
Definition: SlabTraits.h:42
First first
Definition: SlabTraits.h:41
OPEN3D_HOST_DEVICE Pair(const First &_first, const Second &_second)
Definition: SlabTraits.h:44
OPEN3D_HOST_DEVICE Pair()
Definition: SlabTraits.h:43
Definition: SlabTraits.h:30
OPEN3D_HOST_DEVICE iterator_t()
Definition: SlabTraits.h:31
void * second
Definition: SlabTraits.h:36
OPEN3D_HOST_DEVICE iterator_t(void *key_ptr, void *value_ptr)
Definition: SlabTraits.h:32
void * first
Definition: SlabTraits.h:35