source: eviacam/trunk/fuentes/wxutil/waittime.h @ 567

Last change on this file since 567 was 567, checked in by mabarracus, 4 years ago

updated sources to version 2.0.3

  • Property svn:executable set to *
File size: 1.7 KB
Line 
1/////////////////////////////////////////////////////////////////////////////
2// Name:        dwellaction.h
3// Purpose: 
4// Author:      Cesar Mauri Loba (cesar at crea-si dot com)
5// Modified by:
6// Created:     
7// Copyright:   (C) 2008 Cesar Mauri Loba - CREA Software Systems
8//
9//  This program is free software: you can redistribute it and/or modify
10//  it under the terms of the GNU General Public License as published by
11//  the Free Software Foundation, either version 3 of the License, or
12//  (at your option) any later version.
13//
14//  This program is distributed in the hope that it will be useful,
15//  but WITHOUT ANY WARRANTY; without even the implied warranty of
16//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17//  GNU General Public License for more details.
18//
19//  You should have received a copy of the GNU General Public License
20//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
21/////////////////////////////////////////////////////////////////////////////
22
23#ifndef WAITTIME_H
24#define WAITTIME_H
25
26class CWaitTime
27{
28public:
29        CWaitTime(unsigned long waitTimeMs= 1000);
30        ~CWaitTime(void);
31        inline const unsigned long GetWaitTimeMs () const;
32        inline void SetWaitTimeMs (unsigned long val);
33        void Reset ();
34        // If countdown expired returns true once and false for all
35        // subsequent calls until a Reset
36        bool OneShootAction();
37        bool HasExpired() const;
38        int PercentagePassed() const;
39
40private:
41        unsigned long m_timeCountMs, m_waitTimeMs;
42        bool m_actionDone;
43};
44
45inline const unsigned long CWaitTime::GetWaitTimeMs () const
46{
47        return m_waitTimeMs; 
48}
49
50inline void CWaitTime::SetWaitTimeMs (unsigned long val)
51{
52        m_waitTimeMs= val;
53}
54
55#endif
Note: See TracBrowser for help on using the repository browser.