ServiceLifeTime#

class ServiceLifeTime#

Class used to describe service lifetime.

Public Types

enum Type#

3 types of availabe service lifetimes

Values:

enumerator Singleton#
enumerator Scoped#
enumerator Transient#

Public Functions

ServiceLifeTime(Type type)#

Construct a new Service Life Time object with specified type.

ServiceLifeTime(const ServiceLifeTime&) = default#
ServiceLifeTime &operator=(const ServiceLifeTime&) = default#
bool isSingleton() const#

checks if lifetime is singleton

bool isScoped() const#

checks if lifetime is scoped

bool isTransient() const#

checks if lifetime is transient

bool is(Type type) const#

checks if lifetime is given type

bool operator>(const ServiceLifeTime &scope) const#
bool operator<(const ServiceLifeTime &scope) const#
bool operator>=(const ServiceLifeTime &scope) const#
bool operator<=(const ServiceLifeTime &scope) const#
bool operator!=(const ServiceLifeTime &scope) const#
bool operator==(const ServiceLifeTime &scope) const#

Public Static Functions

static ServiceLifeTime singleton()#

creates singleton service lifetime

static ServiceLifeTime scoped()#

creates scoped service lifetime

static ServiceLifeTime transient()#

creates transient service lifetime