Stroika Library 3.0d25
 
Loading...
Searching...
No Matches
Stroika::Foundation::Execution::Activity< STRINGISH_T > Class Template Referencefinal

#include <Activity.h>

Inheritance diagram for Stroika::Foundation::Execution::Activity< STRINGISH_T >:
Stroika::Foundation::Execution::Private_::Activities_::AsStringObj_

Public Member Functions

constexpr Activity (const STRINGISH_T &arg)
 

Detailed Description

template<convertible_to< Characters::String > STRINGISH_T = Characters::String>
class Stroika::Foundation::Execution::Activity< STRINGISH_T >

An Activity is typically a static const or sometimes even constexpr object which contains a description of an ongoing activity. They are generally not meant to be stored or copied, but REFERENCED with DeclareActivity to form a 'current activity stack'.

Example Usage
static constexpr Activity kBuildingThingy_{ "building thingy"sv };
static const auto kOtherActivity = Activity<String>{ "abc" };
// automatic variable activity OK as long as its lifetime longer than reference in DeclareActivity
auto otherActivity = Activity<String> { "abc" + argument }; // activities can be stack based, but these cost more to define
auto lazyEvalActivity = LazyEvalActivity ([&] () -> String { return argument.Repeat (5) + "x"; });
// then for how to use activity object - see DeclareActivity
Note
the intended purpose of this is to provide better 'context' for default exception messages, when exceptions are thrown (by Execution::Throw ()).
See also
CaptureCurrentActivities

Definition at line 55 of file Activity.h.

Constructor & Destructor Documentation

◆ Activity()

template<convertible_to< Characters::String > STRINGISH_T>
requires (is_array_v<STRINGISH_T>)
constexpr Stroika::Foundation::Execution::Activity< STRINGISH_T >::Activity ( const STRINGISH_T &  arg)
constexpr

Definition at line 13 of file Activity.inl.


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