69 lines
1.6 KiB
C++
69 lines
1.6 KiB
C++
/*
|
||
* StatusLogicSetup.cpp
|
||
*
|
||
* Created on: 1 окт. 2019 г.
|
||
* Author: user
|
||
*/
|
||
|
||
#include "StatusLogicSetup.hh"
|
||
|
||
#include <utility>
|
||
|
||
bool application::schematic::StatusNot::input( Environment & env ) {
|
||
|
||
return (a = env.statuses.get( links.a ) );
|
||
|
||
}
|
||
|
||
void application::schematic::StatusNot::build( Environment & env ) {
|
||
|
||
Logic * logic = memories::instance_object<Logic>(env.static_object_ma, *a);
|
||
|
||
env.statuses.add( links.logic_not, logic );
|
||
|
||
}
|
||
|
||
application::schematic::StatusNot::StatusNot( const Links & links ) : links(links) {}
|
||
|
||
bool application::schematic::StatusAnd::input( Environment & env ) {
|
||
|
||
return (a = env.statuses.get( links.a ) ) and (b = env.statuses.get( links.b ) );
|
||
|
||
}
|
||
|
||
void application::schematic::StatusAnd::build( Environment & env ) {
|
||
|
||
systemic::IStatus * statuses[2];
|
||
|
||
statuses[0] = a;
|
||
statuses[1] = b;
|
||
|
||
Logic * logic = memories::instance_object<Logic>(env.static_object_ma, statuses);
|
||
|
||
env.statuses.add( links.logic_and, logic );
|
||
|
||
}
|
||
|
||
application::schematic::StatusAnd::StatusAnd( const Links & links ) : links(links) {}
|
||
|
||
bool application::schematic::StatusOr::input( Environment & env ) {
|
||
|
||
return (a = env.statuses.get( links.a ) ) and (b = env.statuses.get( links.b ) );
|
||
|
||
}
|
||
|
||
void application::schematic::StatusOr::build( Environment & env ) {
|
||
|
||
systemic::IStatus * statuses[2];
|
||
|
||
statuses[0] = a;
|
||
statuses[1] = b;
|
||
|
||
Logic * logic = memories::instance_object<Logic>(env.static_object_ma, statuses);
|
||
|
||
env.statuses.add( links.logic_or, logic );
|
||
|
||
}
|
||
|
||
application::schematic::StatusOr::StatusOr( const Links & links ) : links(links) {}
|