Cbeam
Loading...
Searching...
No Matches
cbeam::lifecycle Namespace Reference

Manages the lifecycle of singletons, item registries, and scoped variables. This namespace introduces powerful constructs such as singleton_control and item_registry for explicitly managing the instantiation and teardown of resources, minimizing global-state risks and encouraging well-defined initialization flows. More...

Classes

struct  extract_atomic_value_type
 Extracts the underlying value type T from either T or std::atomic<T>. More...
 
struct  extract_atomic_value_type< std::atomic< T > >
 
class  item_registry
 Manages the registration and deregistration of items with unique identifiers. More...
 
class  scoped_set
 A helper that sets the given variable to a new value, and restores the original value on destruction. More...
 
class  singleton
 
class  singleton_control
 Base class for controlling the lifecycle of all singleton instances across different types. More...
 

Functions

 TEST (ItemRegistryTest, RegisterNewItem)
 
 TEST (ItemRegistryTest, DeregisterAndReuseId)
 
 TEST (ItemRegistryTest, ReachMaximumItems)
 
 TEST (ItemRegistryTest, RecycleIdentifier)
 

Detailed Description

Manages the lifecycle of singletons, item registries, and scoped variables. This namespace introduces powerful constructs such as singleton_control and item_registry for explicitly managing the instantiation and teardown of resources, minimizing global-state risks and encouraging well-defined initialization flows.

Function Documentation

◆ TEST() [1/4]

cbeam::lifecycle::TEST ( ItemRegistryTest ,
DeregisterAndReuseId  )

◆ TEST() [2/4]

cbeam::lifecycle::TEST ( ItemRegistryTest ,
ReachMaximumItems  )

◆ TEST() [3/4]

cbeam::lifecycle::TEST ( ItemRegistryTest ,
RecycleIdentifier  )

◆ TEST() [4/4]

cbeam::lifecycle::TEST ( ItemRegistryTest ,
RegisterNewItem  )