SMACC
Loading...
Searching...
No Matches
smacc_orthogonal.h
Go to the documentation of this file.
1/*****************************************************************************************************************
2 * ReelRobotix Inc. - Software License Agreement Copyright (c) 2018
3 * Authors: Pablo Inigo Blasco, Brett Aldrich
4 *
5 ******************************************************************************************************************/
6
7#pragma once
8#include <smacc/common.h>
9#include <utility>
10
11namespace smacc
12{
14{
15public:
17
19
20 void initState(ISmaccState *state);
21
22 void addClientBehavior(std::shared_ptr<smacc::ISmaccClientBehavior> clientBehavior);
23
24 void runtimeConfigure();
25
26 void onEntry();
27
28 void onExit();
29
30 void onDispose();
31
32 virtual std::string getName() const;
33
34 template <typename SmaccComponentType>
35 void requiresComponent(SmaccComponentType *&storage);
36
37 template <typename SmaccClientType>
38 bool requiresClient(SmaccClientType *&storage);
39
40 inline const std::vector<std::shared_ptr<smacc::ISmaccClient>> &getClients();
41
42 inline const std::vector<std::vector<std::shared_ptr<smacc::ISmaccClientBehavior>>> &getClientBehaviors() const;
43
44 template <typename T>
45 void setGlobalSMData(std::string name, T value);
46
47 template <typename T>
48 bool getGlobalSMData(std::string name, T &ret);
49
50 template <typename TClientBehavior>
51 TClientBehavior *getClientBehavior();
52
53protected:
54 virtual void onInitialize();
55
56 template <typename TOrthogonal, typename TClient>
58
59 std::vector<std::shared_ptr<smacc::ISmaccClient>> clients_;
60
61private:
63
64 std::vector<std::vector<std::shared_ptr<smacc::ISmaccClientBehavior>>> clientBehaviors_;
65 friend class ISmaccStateMachine;
66};
67
68} // namespace smacc
std::vector< std::shared_ptr< smacc::ISmaccClient > > clients_
void setStateMachine(ISmaccStateMachine *value)
Definition: orthogonal.cpp:7
void assignClientToOrthogonal(TClient *client)
void setGlobalSMData(std::string name, T value)
void requiresComponent(SmaccComponentType *&storage)
ISmaccStateMachine * stateMachine_
virtual std::string getName() const
Definition: orthogonal.cpp:39
TClientBehavior * getClientBehavior()
bool requiresClient(SmaccClientType *&storage)
const std::vector< std::vector< std::shared_ptr< smacc::ISmaccClientBehavior > > > & getClientBehaviors() const
virtual void onInitialize()
Definition: orthogonal.cpp:29
const std::vector< std::shared_ptr< smacc::ISmaccClient > > & getClients()
void initState(ISmaccState *state)
Definition: orthogonal.cpp:33
std::vector< std::vector< std::shared_ptr< smacc::ISmaccClientBehavior > > > clientBehaviors_
bool getGlobalSMData(std::string name, T &ret)
ISmaccStateMachine * getStateMachine()
void addClientBehavior(std::shared_ptr< smacc::ISmaccClientBehavior > clientBehavior)
Definition: orthogonal.cpp:13