GDCM: gdcmARTIMTimer.h Source File

GDCM 3.0.25

gdcmARTIMTimer.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef GDCMARTIMTIMER_H
19#define GDCMARTIMTIMER_H
20
21namespace gdcm {
22 namespace network{
38 class ARTIMTimer
39{
40 private:
41 double mStartTime; //ms timing should be good enough, but there are also
42 //high-resolution timing options. Those return doubles. For now,
43 //go with integer timing solutions based on milliseconds (DWORD on windows),
44 //but leave as doubles to ease transitions to other timing methods.
45
46 double mTimeOut;
47 //once GetCurrentTime() -mStartTime > mTimeout, GetHasExpired returns true.
48
49 double GetCurrentTime() const;//a platform-specific implementation of getting the
50 //current time.
51
52 public:
53 ARTIMTimer(); //initiates the start and timeout at -1;
54 void Start(); //'start' the timer by getting the current wall time
55 void Stop();//'stop' the timer by resetting the 'start' to -1;
56 void SetTimeout(double inTimeout);
57 double GetTimeout() const;
58
59 double GetElapsedTime() const;
60
61 bool GetHasExpired() const;
62
63 };
64 }
65}
66
67#endif //GDCMARTIMTIMER_H
gdcm::network::ARTIMTimer::Start
void Start()
gdcm::network::ARTIMTimer::ARTIMTimer
ARTIMTimer()
gdcm::network::ARTIMTimer::GetElapsedTime
double GetElapsedTime() const
gdcm::network::ARTIMTimer::SetTimeout
void SetTimeout(double inTimeout)
gdcm::network::ARTIMTimer::GetHasExpired
bool GetHasExpired() const
gdcm::network::ARTIMTimer::GetTimeout
double GetTimeout() const
gdcm::network::ARTIMTimer::Stop
void Stop()
gdcm::network
Definition gdcmAAbortPDU.h:24
gdcm
Definition gdcmASN1.h:21