Apollo 10.0
自动驾驶开放平台
class_factory.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 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 <algorithm>
19
20namespace apollo {
21namespace cyber {
22namespace class_loader {
23namespace utility {
24
26 const std::string& class_name, const std::string& base_class_name)
27 : relative_library_path_(""),
28 base_class_name_(base_class_name),
29 class_name_(class_name) {}
30
32
34 const std::string& library_path) {
35 relative_library_path_ = library_path;
36}
37
39 if (std::find(relative_class_loaders_.begin(), relative_class_loaders_.end(),
40 loader) == relative_class_loaders_.end()) {
41 relative_class_loaders_.emplace_back(loader);
42 }
43}
44
46 const ClassLoader* loader) {
47 std::vector<ClassLoader*>::iterator itr = std::find(
49 if (itr != relative_class_loaders_.end()) {
50 relative_class_loaders_.erase(itr);
51 }
52}
53
55 std::vector<ClassLoader*>::iterator itr = std::find(
57 return itr != relative_class_loaders_.end();
58}
59
63
67
71
73 return base_class_name_;
74}
75
76const std::string AbstractClassFactoryBase::GetClassName() const {
77 return class_name_;
78}
79
80} // namespace utility
81} // namespace class_loader
82} // namespace cyber
83} // namespace apollo
for library load,createclass object
void SetRelativeLibraryPath(const std::string &library_path)
AbstractClassFactoryBase(const std::string &class_name, const std::string &base_class_name)
class register implement
Definition arena_queue.h:37