43 lines
1.2 KiB
C++
43 lines
1.2 KiB
C++
/*
|
|
* ActionStatusLogic.cpp
|
|
*
|
|
* Created on: 20 ìàÿ 2020 ã.
|
|
* Author: LeonidTitov
|
|
*/
|
|
|
|
#include "ActionStatusLogic.hh"
|
|
|
|
#include "../../schematic/action/StatusGetAction.hh"
|
|
|
|
bool application::schematic::ActionStatusAnd::input( Environment & env ) {
|
|
|
|
return grab( a, env.rholder.getShared<ActionStatus>( links.a ) ) and
|
|
grab( b, env.rholder.getShared<ActionStatus>( links.b ) );
|
|
}
|
|
|
|
void application::schematic::ActionStatusAnd::build( Environment & env ) {
|
|
|
|
std::logical_and<bool> logical_and;
|
|
Logic * logic = memories::instance_object<Logic>( env.static_setup_ma, logical_and, *a, *b );
|
|
|
|
env.rholder.share<ActionStatus>( *logic, links.logic_and );
|
|
|
|
}
|
|
|
|
bool application::schematic::CheckCondition::input( Environment & env ) {
|
|
|
|
return grab( action, env.rholder.getShared<Action>( links.action ) )
|
|
and ( condition = env.statuses.get( links.condition ) );
|
|
|
|
}
|
|
|
|
void application::schematic::CheckCondition::build( Environment & env ) {
|
|
|
|
typedef ::schematic::functor::StatusGetAction CheckStatusAction;
|
|
|
|
CheckStatusAction * check_action = memories::instance_object<CheckStatusAction>(env.static_object_ma, *condition, *action );
|
|
|
|
env.rholder.share<ActionStatus>( *check_action, links.check );
|
|
|
|
}
|