예제 #1
0
 virtual void output(devs::Time /*time*/,
                     devs::ExternalEventList &output) const override
 {
     Ensures(i == 1);
     i++;
     output.emplace_back("out");
 }
예제 #2
0
void Moore::output(devs::Time time,
		   devs::ExternalEventList& output) const
{
    if (mPhase == PROCESSING) {
        OutputFuncsIterator it = mOutputFuncs.find(currentState());

        if (it != mOutputFuncs.end()) {
            (it->second)(time, output);
        } else {
            OutputsIterator ito = mOutputs.find(currentState());

            if (ito != mOutputs.end()) {
                output.emplace_back(ito->second);
            }
        }
    }
}
예제 #3
0
void Mealy::output(devs::Time time,
		   devs::ExternalEventList& output) const
{
    if (mPhase == PROCESSING) {
        const devs::ExternalEventList& events = *mToProcessEvents.front();
        const devs::ExternalEvent& event = events.front();
        OutputFuncsIterator itof = mOutputFuncs.find(currentState());

        if (itof != mOutputFuncs.end()  and
            itof->second.find(event.getPortName()) != itof->second.end()) {
            (itof->second.find(event.getPortName())->second)(time, output);
        } else {
            OutputsIterator ito = mOutputs.find(currentState());

            if (ito != mOutputs.end() and
                ito->second.find(event.getPortName()) != ito->second.end()) {
                output.emplace_back(
                    ito->second.find(event.getPortName())->second);
            }
        }
    }
}
예제 #4
0
 virtual void output(devs::Time /*time*/,
                     devs::ExternalEventList &output) const override
 {
     output.emplace_back("out");
     output.back().addString("leaf");
 }
예제 #5
0
 virtual void output(devs::Time /* time */,
                     devs::ExternalEventList &output) const override
 {
     for (int i = 0; i < m_counter; ++i)
         output.emplace_back("out");
 }