SMACC2
Loading...
Searching...
No Matches
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{
30
32{
33 RCLCPP_WARN_STREAM(
34 getLogger(), "[" << getName() << "]"
35 << " Client behavior deallocated");
36}
37
38std::string ISmaccClientBehavior::getName() const { return demangleSymbol(typeid(*this).name()); }
39
40rclcpp::Node::SharedPtr ISmaccClientBehavior::getNode() const
41{
42 return this->stateMachine_->getNode();
43}
44
45rclcpp::Logger ISmaccClientBehavior::getLogger() const
46{
47 auto nh = this->getNode();
48 if (nh != nullptr)
49 {
50 return nh->get_logger();
51 }
52 else
53 {
54 return rclcpp::get_logger("SMACC");
55 }
56}
57
59{
60 RCLCPP_DEBUG(
61 getLogger(), "[%s] Default empty SmaccClientBehavior runtimeConfigure()",
62 this->getName().c_str());
63}
64
66{
67 RCLCPP_DEBUG(
68 getLogger(), "[%s] Default empty SmaccClientBehavior onEntry()", this->getName().c_str());
69 this->onEntry();
70}
71
73{
74 RCLCPP_DEBUG(
75 getLogger(), "[%s] Default empty SmaccClientBehavior onExit()", this->getName().c_str());
76 this->onExit();
77}
78
80
81} // namespace smacc2
virtual rclcpp::Logger getLogger() const
virtual rclcpp::Node::SharedPtr getNode() const
rclcpp::Node::SharedPtr getNode()
std::string demangleSymbol()