Apollo  6.0
Open source self driving car software
service_base.h
Go to the documentation of this file.
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  *****************************************************************************/
16 
17 #ifndef CYBER_SERVICE_SERVICE_BASE_H_
18 #define CYBER_SERVICE_SERVICE_BASE_H_
19 
20 #include <string>
21 
22 namespace apollo {
23 namespace cyber {
24 
30 class ServiceBase {
31  public:
37  explicit ServiceBase(const std::string& service_name)
38  : service_name_(service_name) {}
39 
40  virtual ~ServiceBase() {}
41 
42  virtual void destroy() = 0;
43 
47  const std::string& service_name() const { return service_name_; }
48 
49  protected:
50  std::string service_name_;
51 };
52 
53 } // namespace cyber
54 } // namespace apollo
55 
56 #endif // CYBER_SERVICE_SERVICE_BASE_H_
Base class for Service.
Definition: service_base.h:30
std::string service_name_
Definition: service_base.h:50
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
const std::string & service_name() const
Get the service name.
Definition: service_base.h:47
virtual ~ServiceBase()
Definition: service_base.h:40
virtual void destroy()=0
ServiceBase(const std::string &service_name)
Construct a new Service Base object.
Definition: service_base.h:37