NuTo
Numerics Tool
UniqueId.h
Go to the documentation of this file.
1 #pragma once
2 
3 namespace NuTo
4 {
9 template <typename T>
10 class UniqueId
11 {
12 public:
14  : mId(mIdCounter++)
15  {
16  }
17 
18  int Id() const
19  {
20  return mId;
21  }
22 
23 private:
24  int mId;
25  static int mIdCounter;
26 };
27 
28 template <typename T>
30 
31 } /* NuTo */
UniqueId()
Definition: UniqueId.h:13
This class provides a unique id (beginning at 0 and incrementing for each object).
Definition: UniqueId.h:10
int Id() const
Definition: UniqueId.h:18
Definition: Exception.h:6