diff options
| author | Naios <naios-dev@live.de> | 2015-07-21 20:23:21 +0200 |
|---|---|---|
| committer | Naios <naios-dev@live.de> | 2015-07-21 20:25:33 +0200 |
| commit | 6e4a1b3e1e5a735f26284c560b1463cdd527b2fe (patch) | |
| tree | 42b043578178648b168a78cdea890bfdf8e00cf0 /src | |
| parent | d41f87e62abef6fa4b0dc23274023d91bdc005d8 (diff) | |
Core/Utilities: Seperate std::chrono::duration typedefs into its own file.
* add std::chrono_literals using decl. comment for future usage.
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/shared/Utilities/Duration.h | 39 | ||||
| -rw-r--r-- | src/server/shared/Utilities/TaskScheduler.h | 13 |
2 files changed, 40 insertions, 12 deletions
diff --git a/src/server/shared/Utilities/Duration.h b/src/server/shared/Utilities/Duration.h new file mode 100644 index 00000000000..58a08e5842f --- /dev/null +++ b/src/server/shared/Utilities/Duration.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef _DURATION_H_ +#define _DURATION_H_ + +#include <chrono> + +/// Milliseconds shorthand typedef. +typedef std::chrono::milliseconds Milliseconds; + +/// Seconds shorthand typedef. +typedef std::chrono::seconds Seconds; + +/// Minutes shorthand typedef. +typedef std::chrono::minutes Minutes; + +/// Hours shorthand typedef. +typedef std::chrono::hours Hours; + +/// Makes std::chrono_literals globally available. +// ToDo: Enable this when TC supports C++14. +// using namespace std::chrono_literals; + +#endif // _DURATION_H_ diff --git a/src/server/shared/Utilities/TaskScheduler.h b/src/server/shared/Utilities/TaskScheduler.h index d45835b5f17..f1fe7ea0a21 100644 --- a/src/server/shared/Utilities/TaskScheduler.h +++ b/src/server/shared/Utilities/TaskScheduler.h @@ -29,6 +29,7 @@ #include <boost/optional.hpp> #include "Util.h" +#include "Duration.h" class TaskContext; @@ -646,16 +647,4 @@ private: void Invoke(); }; -/// Milliseconds shorthand typedef. -typedef std::chrono::milliseconds Milliseconds; - -/// Seconds shorthand typedef. -typedef std::chrono::seconds Seconds; - -/// Minutes shorthand typedef. -typedef std::chrono::minutes Minutes; - -/// Hours shorthand typedef. -typedef std::chrono::hours Hours; - #endif /// _TASK_SCHEDULER_H_ |
