SMACC
Loading...
Searching...
No Matches
smacc_component_impl.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
9#include <smacc/component.h>
11
12namespace smacc
13{
14 template <typename EventType>
15 void ISmaccComponent::postEvent(const EventType &ev)
16 {
18 }
19
20 template <typename TComponent>
21 void ISmaccComponent::requiresComponent(TComponent *&requiredComponentStorage)
22 {
23 requiredComponentStorage = this->owner_->getComponent<TComponent>();
24 }
25
26 template <typename TClient>
27 void ISmaccComponent::requiresClient(TClient *&requiredClientStorage)
28 {
29 this->owner_->requiresClient(requiredClientStorage);
30 }
31
32 template <typename SmaccComponentType, typename TOrthogonal, typename TClient, typename... TArgs>
33 SmaccComponentType *ISmaccComponent::createSiblingComponent(TArgs... targs)
34 {
35 return this->owner_->createComponent<SmaccComponentType, TOrthogonal, TClient>(targs...);
36 }
37
38 template <typename SmaccComponentType, typename TOrthogonal, typename TClient, typename... TArgs>
39 SmaccComponentType *ISmaccComponent::createSiblingNamedComponent(std::string name, TArgs... targs)
40 {
41 return this->owner_->createNamedComponent<SmaccComponentType, TOrthogonal, TClient>(name, targs...);
42 }
43
44} // namespace smacc
SmaccComponentType * createComponent(TArgs... targs)
void requiresClient(SmaccClientType *&storage)
TComponent * getComponent()
SmaccComponentType * createNamedComponent(std::string name, TArgs... targs)
void requiresClient(TClient *&requiredClientStorage)
SmaccComponentType * createSiblingComponent(TArgs... targs)
SmaccComponentType * createSiblingNamedComponent(std::string name, TArgs... targs)
ISmaccClient * owner_
Definition: component.h:57
void requiresComponent(TComponent *&requiredComponentStorage)
ISmaccStateMachine * stateMachine_
Definition: component.h:55
void postEvent(EventType *ev, EventLifeTime evlifetime=EventLifeTime::ABSOLUTE)