DUNE-FEM (unstable)

idprovider.hh
1#ifndef DUNE_FEM_IDPROVIDER_HH
2#define DUNE_FEM_IDPROVIDER_HH
3
4#include <cstdlib>
5
6#include <dune/fem/storage/singleton.hh>
7
8namespace Dune
9{
10
11 namespace Fem
12 {
13
16 {
17 public:
18 friend class Dune::Fem::Singleton< IdProvider >;
19
22 {
24 }
25
28 size_t newId() { return lowestFreeId_++; }
29
32 lowestFreeId_(0)
33 {}
34
35 private:
36 IdProvider(const IdProvider&);
37 IdProvider& operator=(const IdProvider&);
38
39 private:
40 size_t lowestFreeId_;
41 };
42
43 } // namespace Fem
44
45} // namespace Dune
46
47#endif // #ifndef DUNE_FEM_IDPROVIDER_HH
Singleton that manages a globally unique identifier.
Definition: idprovider.hh:16
IdProvider()
Constructor (for the singleton object)
Definition: idprovider.hh:31
size_t newId()
Definition: idprovider.hh:28
static IdProvider & instance()
Access to the singleton object.
Definition: idprovider.hh:21
return singleton instance of given Object type.
Definition: singleton.hh:93
static DUNE_EXPORT Object & instance(Args &&... args)
return singleton instance of given Object type.
Definition: singleton.hh:123
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 24, 23:30, 2024)