#include "Compito.h" #include "Sincronizzatore.h" Compito::Compito( Sincronizzatore* s ): tempo_( 0 ), sinc_( s ) { } Compito::~Compito() { } double Compito::tempoProssimoEvento() const { return tempo_; } void Compito::abilita() { if ( sinc_ != 0 ) { tempo_ = sinc_->tempo() + deltaT(); sinc_->aggiungi( this ); } } bool Compito::esegui() { bool attivo = svolgiCompito(); if ( attivo ) tempo_ += deltaT(); return attivo; }