Apollo
10.0
自动驾驶开放平台
ndt_map_matrix_handler.cc
浏览该文件的文档.
1
/******************************************************************************
2
* Copyright 2019 The Apollo Authors. All Rights Reserved.
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
#include "
modules/localization/msf/local_pyramid_map/ndt_map/ndt_map_matrix_handler.h
"
17
18
#include <memory>
19
20
namespace
apollo
{
21
namespace
localization {
22
namespace
msf {
23
namespace
pyramid_map {
24
// =================PyramidMapMatrixHandlerSelector=================
25
NdtMapMatrixHandlerSelector::NdtMapMatrixHandlerSelector
() {}
26
27
NdtMapMatrixHandlerSelector::~NdtMapMatrixHandlerSelector
() {}
28
29
BaseMapMatrixHandler
*
NdtMapMatrixHandlerSelector::AllocNdtMapMatrixHandler
() {
30
return
new
NdtMapMatrixHandler
();
31
}
32
33
NdtMapMatrixHandler::NdtMapMatrixHandler
() {}
34
NdtMapMatrixHandler::~NdtMapMatrixHandler
() {}
35
36
size_t
NdtMapMatrixHandler::LoadBinary
(
const
unsigned
char
* buf,
37
std::shared_ptr<BaseMapMatrix> matrix) {
38
if
(!matrix) {
39
return
0;
40
}
41
std::shared_ptr<NdtMapMatrix> ndt_matrix =
42
std::dynamic_pointer_cast<NdtMapMatrix>(matrix);
43
size_t
size = ndt_matrix->LoadBinary(buf);
44
return
size;
45
}
50
size_t
NdtMapMatrixHandler::CreateBinary
(
51
const
std::shared_ptr<BaseMapMatrix> matrix,
unsigned
char
* buf,
52
size_t
buf_size) {
53
if
(!matrix) {
54
return
0;
55
}
56
const
std::shared_ptr<NdtMapMatrix> ndt_matrix =
57
std::dynamic_pointer_cast<NdtMapMatrix>(matrix);
58
return
ndt_matrix->CreateBinary(buf, buf_size);
59
}
61
size_t
NdtMapMatrixHandler::GetBinarySize
(
62
const
std::shared_ptr<BaseMapMatrix> matrix) {
63
const
std::shared_ptr<NdtMapMatrix> ndt_matrix =
64
std::dynamic_pointer_cast<NdtMapMatrix>(matrix);
65
return
ndt_matrix->GetBinarySize();
66
}
67
68
}
// namespace pyramid_map
69
}
// namespace msf
70
}
// namespace localization
71
}
// namespace apollo
apollo::localization::msf::pyramid_map::BaseMapMatrixHandler
Definition
base_map_matrix_handler.h:27
apollo::localization::msf::pyramid_map::NdtMapMatrixHandlerSelector::~NdtMapMatrixHandlerSelector
~NdtMapMatrixHandlerSelector()
Definition
ndt_map_matrix_handler.cc:27
apollo::localization::msf::pyramid_map::NdtMapMatrixHandlerSelector::AllocNdtMapMatrixHandler
static BaseMapMatrixHandler * AllocNdtMapMatrixHandler()
Definition
ndt_map_matrix_handler.cc:29
apollo::localization::msf::pyramid_map::NdtMapMatrixHandlerSelector::NdtMapMatrixHandlerSelector
NdtMapMatrixHandlerSelector()
Definition
ndt_map_matrix_handler.cc:25
apollo::localization::msf::pyramid_map::NdtMapMatrixHandler
Definition
ndt_map_matrix_handler.h:35
apollo::localization::msf::pyramid_map::NdtMapMatrixHandler::LoadBinary
size_t LoadBinary(const unsigned char *buf, std::shared_ptr< BaseMapMatrix > matrix)
Load the map cell from a binary chunk.
Definition
ndt_map_matrix_handler.cc:36
apollo::localization::msf::pyramid_map::NdtMapMatrixHandler::CreateBinary
size_t CreateBinary(const std::shared_ptr< BaseMapMatrix > matrix, unsigned char *buf, size_t buf_size)
Create the binary.
Definition
ndt_map_matrix_handler.cc:50
apollo::localization::msf::pyramid_map::NdtMapMatrixHandler::NdtMapMatrixHandler
NdtMapMatrixHandler()
Definition
ndt_map_matrix_handler.cc:33
apollo::localization::msf::pyramid_map::NdtMapMatrixHandler::GetBinarySize
size_t GetBinarySize(const std::shared_ptr< BaseMapMatrix > matrix)
Get the binary size of the object.
Definition
ndt_map_matrix_handler.cc:61
apollo::localization::msf::pyramid_map::NdtMapMatrixHandler::~NdtMapMatrixHandler
virtual ~NdtMapMatrixHandler()
Definition
ndt_map_matrix_handler.cc:34
apollo
class register implement
Definition
arena_queue.h:37
ndt_map_matrix_handler.h
modules
localization
msf
local_pyramid_map
ndt_map
ndt_map_matrix_handler.cc