PLaSK library
Loading...
Searching...
No Matches
id.cpp
Go to the documentation of this file.
1/*
2 * This file is part of PLaSK (https://plask.app) by Photonics Group at TUL
3 * Copyright (c) 2022 Lodz University of Technology
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14#include "id.hpp"
15
16#include <atomic>
17#include <boost/lexical_cast.hpp>
18
19namespace plask {
20
21std::atomic<std::uint64_t> id;
22//std::uint64_t id;
23
24std::uint64_t getUniqueNumber() {
25 return ++id;
26}
27
28std::string getUniqueString() {
29 return boost::lexical_cast<std::string>(getUniqueNumber());
30}
31
32} // namespace plask