Example #1
0
 virtual void output(devs::Time /*time*/,
                     devs::ExternalEventList &output) const override
 {
     Ensures(i == 1);
     i++;
     output.emplace_back("out");
 }
Example #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);
            }
        }
    }
}
Example #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);
            }
        }
    }
}
Example #4
0
 virtual void output(devs::Time /*time*/,
                     devs::ExternalEventList &output) const override
 {
     output.emplace_back("out");
     output.back().addString("leaf");
 }
Example #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");
 }