SMACC2
smacc_client_behavior_base.cpp
Go to the documentation of this file.
1// Copyright 2021 RobosoftAI Inc.
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/*****************************************************************************************************************
16 *
17 * Authors: Pablo Inigo Blasco, Brett Aldrich
18 *
19 ******************************************************************************************************************/
20
22
23namespace smacc2
24{
26{
27 stateMachine_ = nullptr;
28 currentState = nullptr;
29}
30
32{
33 RCLCPP_WARN(getLogger(), "Client behavior deallocated.");
34}
35
36std::string ISmaccClientBehavior::getName() const { return demangleSymbol(typeid(*this).name()); }
37
38rclcpp::Node::SharedPtr ISmaccClientBehavior::getNode() { return this->stateMachine_->getNode(); }
39
41{
42 auto nh = this->getNode();
43 if (nh != nullptr)
44 {
45 return nh->get_logger();
46 }
47 else
48 {
49 return rclcpp::get_logger("SMACC");
50 }
51}
52
54{
55 RCLCPP_DEBUG(
56 getLogger(), "[%s] Default empty SmaccClientBehavior runtimeConfigure",
57 this->getName().c_str());
58}
59
61{
62 RCLCPP_DEBUG(
63 getLogger(), "[%s] Default empty SmaccClientBehavior onEntry", this->getName().c_str());
64 this->onEntry();
65}
66
68{
69 RCLCPP_DEBUG(
70 getLogger(), "[%s] Default empty SmaccClientBehavior onExit", this->getName().c_str());
71 this->onExit();
72}
73
75
76} // namespace smacc2
virtual rclcpp::Node::SharedPtr getNode()
rclcpp::Node::SharedPtr getNode()
std::string demangleSymbol(const std::string &name)