Loading...
Searching...
No Matches
Time.hpp
Go to the documentation of this file.
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2023 Laurent Gomila (laurent@sfml-dev.org)
5//
6// This software is provided 'as-is', without any express or implied warranty.
7// In no event will the authors be held liable for any damages arising from the use of this software.
8//
9// Permission is granted to anyone to use this software for any purpose,
10// including commercial applications, and to alter it and redistribute it freely,
11// subject to the following restrictions:
12//
13// 1. The origin of this software must not be misrepresented;
14// you must not claim that you wrote the original software.
15// If you use this software in a product, an acknowledgment
16// in the product documentation would be appreciated but is not required.
17//
18// 2. Altered source versions must be plainly marked as such,
19// and must not be misrepresented as being the original software.
20//
21// 3. This notice may not be removed or altered from any source distribution.
22//
24
25#ifndef SFML_TIME_HPP
26#define SFML_TIME_HPP
27
29// Headers
32
33
34namespace sf
35{
41{
42public:
43
51
60 float asSeconds() const;
61
71
81
83 // Static member data
85 static const Time Zero;
86
87private:
88
92
102 explicit Time(Int64 microseconds);
103
104private:
105
107 // Member data
109 Int64 m_microseconds;
110};
111
124
137
150
162
174
186
198
210
222
233
245
257
269
281
293
305
317
329
341
353
365
377
389
401
413
425
437
438} // namespace sf
439
440
441#endif // SFML_TIME_HPP
442
443
#define SFML_SYSTEM_API
Color operator+(const Color &left, const Color &right)
Overload of the binary + operator.
Color operator*(const Color &left, const Color &right)
Overload of the binary * operator.
Color operator-(const Color &left, const Color &right)
Overload of the binary - operator.
Color & operator-=(Color &left, const Color &right)
Overload of the binary -= operator.
Color & operator*=(Color &left, const Color &right)
Overload of the binary *= operator.
Color & operator+=(Color &left, const Color &right)
Overload of the binary += operator.
Int64 asMicroseconds() const
Return the time value as a number of microseconds.
friend Time milliseconds(Int32)
friend Time microseconds(Int64)
Time operator/(Time left, float right)
Overload of binary / operator to scale a time value.
Time & operator%=(Time &left, Time right)
Overload of binary %= operator to compute/assign remainder of a time value.
Time microseconds(Int64 amount)
Construct a time value from a number of microseconds.
static const Time Zero
Predefined "zero" time value.
Definition Time.hpp:85
Time milliseconds(Int32 amount)
Construct a time value from a number of milliseconds.
Int32 asMilliseconds() const
Return the time value as a number of milliseconds.
float asSeconds() const
Return the time value as a number of seconds.
Time operator%(Time left, Time right)
Overload of binary % operator to compute remainder of a time value.
friend Time seconds(float)
Time()
Default constructor.
Time & operator/=(Time &left, float right)
Overload of binary /= operator to scale/assign a time value.
Time seconds(float amount)
Construct a time value from a number of seconds.
bool operator==(const IpAddress &left, const IpAddress &right)
Overload of == operator to compare two IP addresses.
signed long long Int64
Definition Config.hpp:238
bool operator>=(const IpAddress &left, const IpAddress &right)
Overload of >= operator to compare two IP addresses.
bool operator!=(const IpAddress &left, const IpAddress &right)
Overload of != operator to compare two IP addresses.
bool operator<=(const IpAddress &left, const IpAddress &right)
Overload of <= operator to compare two IP addresses.
signed int Int32
Definition Config.hpp:226
bool operator<(const IpAddress &left, const IpAddress &right)
Overload of < operator to compare two IP addresses.
bool operator>(const IpAddress &left, const IpAddress &right)
Overload of > operator to compare two IP addresses.