SMACC2
sm_name.hpp
Go to the documentation of this file.
1// Copyright 2021 MyName/MyCompany Inc.
2// Copyright 2021 RobosoftAI Inc. (template)
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#pragma once
17
18#include <memory>
19#include <string>
20
21#include "smacc2/smacc.hpp"
22
23// ORTHOGONALS
24#include "$sm_name$/orthogonals/or_timer.hpp"
25
26namespace $sm_name$
27{
28// SMACC2 clases
29using $sm_name$::OrTimer; // This is example variable - feel free to delete it.
30
31//STATES
32struct State1;
33struct State2;
34
35//--------------------------------------------------------------------
36//STATE_MACHINE
37struct $SmName$
38: public smacc2::SmaccStateMachineBase<$SmName$, State1>
39{
40 using SmaccStateMachineBase::SmaccStateMachineBase;
41
42 void onInitialize() override
43 {
44 // START: Example code - change or delete as needed
45 this->createOrthogonal<OrTimer>();
46 // Use Blackboard to store global state-machine data - example - feel free to delete it.
48 "output_message_note", std::string("{I am very cool smacc2 SM called '$sm_name$'}"));
49 // END: Example code - change or delete as needed
50 }
51};
52
53} // namespace $sm_name$
54
55//STATES
56#include "states/st_state_1.hpp"
57#include "states/st_state_2.hpp"
void setGlobalSMData(std::string name, T value)
void onInitialize() override
this function should be implemented by the user to create the orthogonals
Definition: sm_name.hpp:42