📄 event.cpp
字号:
/*************************************************************************** event.cpp - description ------------------- begin : Thu Apr 8 2004 copyright : (C) 2004 by Daroth-U email : daroth-u@ifrance.com ***************************************************************************//*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/#include "event.h"int Event::globalId=0;Event::Event(){}// This event will occur nbExecutionsTD time every tmOut from currentDate.Event::Event(Date currentDate, Date tmOut, long nbExecutionsToDo){ this->nbExecutions = 0; this->nbExecutionsToDo = nbExecutionsToDo; this->timeOut = tmOut; this->eventDate = tmOut; this->eventDate.addDate(currentDate); eventId = globalId; globalId++; } // This event will occur only one time at the given dateEvent::Event(Date eventDate){ this->nbExecutions = 0; this->nbExecutionsToDo = 1; this->timeOut.setDate(0,0,0,0,0,0); this->eventDate = eventDate; eventId = globalId; globalId++; }// Events are automatically deleted unless nbExecutionsToDo is set to infinite.// This will be the case for thirstHungerEvent for example.// That's why we set nbExecutionsToDO so that this event // is deleted from scheduled events list at the next time out.void Event::scheduleDeleteEvent(){ nbExecutionsToDo = 1; nbExecutions = 2; //cout << eventId << " will be deleted next time." << endl; }Event::~Event(){}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -