///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TBF.BenchControl
{
///
/// This interface has to be implemented by each 'operation'. 'operations' are classes
/// in TBF.BenchControl name space with a class name ending with 'Op' (e.g. TimerOp).
/// This class name rule is a convention, not a requirement.
///
public interface IOperation
{
///
/// Method is called when a state machine enters a state in which this operation
/// takes place/ will be executed.
/// Method is not called when this operation took place also in the previous state.
/// StateMachine checks whether Start() should be called depending on the previous
/// and the current state.
///
/// true on success
void Start();
///
/// Method is called in regular time intervals when state machine is
/// in a state in which this operation takes place.
/// During operation the IOparation derived object may issue events,
/// that means Run() method returns a value different from Event.Void (=0).
/// Examples: Timer expired
///
///
Event Run();
///
/// Method is called when the state machine leaves a state in which
/// this operation takes place / was executed.
/// Method is not called when this operation takes place also in the next state.
/// StateMachine checks whether Start() should be called depending on the previous
/// and the current state.
///
void Stop();
}
}