SMACC2
Loading...
Searching...
No Matches
client.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
23
24namespace smacc2
25{
27
29
31
33
34void ISmaccClient::getComponents(std::vector<std::shared_ptr<ISmaccComponent>> & components)
35{
36 for (auto & ce : components_)
37 {
38 components.push_back(ce.second);
39 }
40}
41
42std::string ISmaccClient::getName() const
43{
44 std::string keyname = demangleSymbol(typeid(*this).name());
45 return keyname;
46}
47
49{
50 stateMachine_ = stateMachine;
51}
52
53void ISmaccClient::setOrthogonal(ISmaccOrthogonal * orthogonal) { orthogonal_ = orthogonal; }
54
56{
58}
59
60rclcpp::Node::SharedPtr ISmaccClient::getNode() { return this->getStateMachine()->getNode(); }
61
62} // namespace smacc2
ISmaccStateMachine * stateMachine_
virtual void onInitialize()
Definition: client.cpp:32
rclcpp::Node::SharedPtr getNode()
Definition: client.cpp:60
ISmaccStateMachine * getStateMachine()
std::map< ComponentKey, std::shared_ptr< smacc2::ISmaccComponent > > components_
void setStateMachine(ISmaccStateMachine *stateMachine)
Definition: client.cpp:48
virtual std::string getName() const
Definition: client.cpp:42
void setOrthogonal(ISmaccOrthogonal *orthogonal)
Definition: client.cpp:53
virtual smacc2::introspection::TypeInfo::Ptr getType()
Definition: client.cpp:55
ISmaccOrthogonal * orthogonal_
void getComponents(std::vector< std::shared_ptr< ISmaccComponent > > &components)
Definition: client.cpp:34
virtual ~ISmaccClient()
Definition: client.cpp:28
rclcpp::Node::SharedPtr getNode()
std::shared_ptr< TypeInfo > Ptr
static TypeInfo::Ptr getFromStdTypeInfo(const std::type_info &tid)
std::string demangleSymbol()