Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
model::StaticID< Derived > Class Template Reference

A class template that implements a counter of the number of instances of Derived type that are created at runtime. It also provides a unique increasing static identifier (sID) for each instance. More...

#include <StaticID.h>

Inheritance diagram for model::StaticID< Derived >:
Collaboration diagram for model::StaticID< Derived >:

Public Member Functions

 StaticID ()
 StaticID (const StaticID &)

Static Public Member Functions

static size_t nextID ()
static size_t & get_count ()
static void set_count (const size_t &newCount)
static void force_count (const size_t &newCount)
static void set_increment (const size_t &newIncrement)

Public Attributes

const size_t sID
 The static ID of this.

Detailed Description

template<typename Derived>
class model::StaticID< Derived >

A class template that implements a counter of the number of instances of Derived type that are created at runtime. It also provides a unique increasing static identifier (sID) for each instance.

Example:

Output:

Definition at line 28 of file StaticID.h.

Constructor & Destructor Documentation

◆ StaticID() [1/2]

template<typename Derived>
model::StaticID< Derived >::StaticID ( )
inline

Definition at line 43 of file StaticID.h.

◆ StaticID() [2/2]

template<typename Derived>
model::StaticID< Derived >::StaticID ( const StaticID< Derived > & )
inline

Definition at line 49 of file StaticID.h.

Member Function Documentation

◆ force_count()

template<typename Derived>
void model::StaticID< Derived >::force_count ( const size_t & newCount)
inlinestatic

Definition at line 79 of file StaticID.h.

◆ get_count()

template<typename Derived>
size_t & model::StaticID< Derived >::get_count ( )
inlinestatic

Definition at line 60 of file StaticID.h.

◆ nextID()

template<typename Derived>
size_t model::StaticID< Derived >::nextID ( )
inlinestatic

Definition at line 55 of file StaticID.h.

◆ set_count()

template<typename Derived>
void model::StaticID< Derived >::set_count ( const size_t & newCount)
inlinestatic

Definition at line 65 of file StaticID.h.

◆ set_increment()

template<typename Derived>
void model::StaticID< Derived >::set_increment ( const size_t & newIncrement)
inlinestatic

Definition at line 85 of file StaticID.h.

Member Data Documentation

◆ sID

template<typename Derived>
const size_t model::StaticID< Derived >::sID

The static ID of this.

Definition at line 41 of file StaticID.h.


The documentation for this class was generated from the following file: