CORESENSE4home_Architecture
Loading...
Searching...
No Matches
Core.hpp
Go to the documentation of this file.
1// Copyright 2024 Intelligent Robotics Lab
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef CS4HOME_CORE__CORE_HPP_
16#define CS4HOME_CORE__CORE_HPP_
17
18#include <memory>
19
22
23#include "rclcpp_lifecycle/lifecycle_node.hpp"
24#include "rclcpp/macros.hpp"
25
26namespace cs4home_core
27{
28
34class Core
35{
36public:
37 RCLCPP_SMART_PTR_DEFINITIONS(Core)
38
39
43 explicit Core(rclcpp_lifecycle::LifecycleNode::SharedPtr parent);
44
49 virtual bool configure() = 0;
50
55 virtual bool activate() = 0;
56
61 virtual bool deactivate() = 0;
62
67 void set_afferent(cs4home_core::Afferent::SharedPtr afferent) {afferent_ = afferent;}
68
73 void set_efferent(cs4home_core::Efferent::SharedPtr efferent) {efferent_ = efferent;}
74
75protected:
77 rclcpp_lifecycle::LifecycleNode::SharedPtr parent_;
79 cs4home_core::Afferent::SharedPtr afferent_;
81 cs4home_core::Efferent::SharedPtr efferent_;
82};
83
84} // namespace cs4home_core
85
86#endif // CS4HOME_CORE__CORE_HPP_
virtual bool deactivate()=0
Deactivates the Core component.
virtual bool configure()=0
Configures the Core component.
Definition Core.cpp:34
void set_efferent(cs4home_core::Efferent::SharedPtr efferent)
Sets the Efferent component associated with this Core.
Definition Core.hpp:73
cs4home_core::Efferent::SharedPtr efferent_
Shared pointer to the Efferent component.
Definition Core.hpp:81
rclcpp_lifecycle::LifecycleNode::SharedPtr parent_
Shared pointer to the parent lifecycle node.
Definition Core.hpp:77
Core(rclcpp_lifecycle::LifecycleNode::SharedPtr parent)
Constructs a Core object associated with a parent lifecycle node.
Definition Core.cpp:24
virtual bool activate()=0
Activates the Core component.
void set_afferent(cs4home_core::Afferent::SharedPtr afferent)
Sets the Afferent component associated with this Core.
Definition Core.hpp:67
cs4home_core::Afferent::SharedPtr afferent_
Shared pointer to the Afferent component.
Definition Core.hpp:79
Definition Afferent.hpp:32