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 *****************************************************************************/
17
18#include <memory>
19
20namespace apollo {
21namespace localization {
22namespace msf {
23namespace pyramid_map {
24// =================PyramidMapMatrixHandlerSelector=================
26
28
32
35
36size_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}
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}
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
size_t LoadBinary(const unsigned char *buf, std::shared_ptr< BaseMapMatrix > matrix)
Load the map cell from a binary chunk.
size_t CreateBinary(const std::shared_ptr< BaseMapMatrix > matrix, unsigned char *buf, size_t buf_size)
Create the binary.
size_t GetBinarySize(const std::shared_ptr< BaseMapMatrix > matrix)
Get the binary size of the object.
class register implement
Definition arena_queue.h:37