52 lines
1.0 KiB
C++
52 lines
1.0 KiB
C++
/*
|
|
* DynamicFlagInitializer.cpp
|
|
*
|
|
* Created on: 29 íîÿá. 2023 ã.
|
|
* Author: titov
|
|
*/
|
|
|
|
#include "DynamicFlag.hh"
|
|
|
|
#include "../../systemic/ApplyParameter.hpp"
|
|
|
|
bool application::schematic::DynamicFlag::input( Environment & env ) {
|
|
|
|
return ( parameter = systemic::getSetting<Settable>( env.cparams, provider, links.preset ) );
|
|
|
|
}
|
|
|
|
void application::schematic::DynamicFlag::build( Environment & env ) {
|
|
|
|
Settable * df = memories::instance_object<Settable>(env.static_object_ma);
|
|
|
|
typedef systemic::ApplyParameter<Settable> ApplySettable;
|
|
typedef systemic::IValueType<bool> FlagInterface;
|
|
typedef systemic::IFunctor<void> Action;
|
|
|
|
ApplySettable * ap = memories::instance_object<ApplySettable>(env.static_object_ma, *df, parameter);
|
|
|
|
(*ap)();
|
|
|
|
if( links.value ) {
|
|
|
|
env.statuses.create( links.value, df->value() );
|
|
|
|
}
|
|
|
|
if( links.set ) {
|
|
|
|
env.rholder.share<FlagInterface>( *df, links.set );
|
|
|
|
}
|
|
|
|
if( links.reset ) {
|
|
|
|
env.rholder.share<Action>( *ap, links.reset );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|