Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
InstrumentHelpers.inl
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4
5namespace Stroika::Frameworks::SystemPerformance::Support {
6
7 /*
8 ********************************************************************************
9 ***** SystemPerformance::Support::InstrumentHelpers::InstrumentRep_COMMON ******
10 ********************************************************************************
11 */
12 template <typename OPTIONS, derived_from<Context> CONTEXT>
13 inline InstrumentRep_COMMON<OPTIONS, CONTEXT>::InstrumentRep_COMMON (const OPTIONS& options, const shared_ptr<CONTEXT>& context)
14 : _fOptions{options}
15 , _fContext{context}
16 {
17 RequireNotNull (_fContext.cget ().cref ());
18 }
19 template <typename OPTIONS, derived_from<Context> CONTEXT>
21 {
22 AssertNotNull (_fContext.cget ().cref ());
23 return _fContext.cget ().cref ()->fCaptureContextAt.value_or (fInstrumentCreatedAt_);
24 }
25 template <typename OPTIONS, derived_from<Context> CONTEXT>
27 {
28 AssertNotNull (_fContext.cget ().cref ());
29 _fContext.rwget ().rwref ()->fCaptureContextAt = at;
30 }
31
32}
#define AssertNotNull(p)
Definition Assertions.h:333
#define RequireNotNull(p)
Definition Assertions.h:347
time_point< RealtimeClock, DurationSeconds > TimePointSeconds
TimePointSeconds is a simpler approach to chrono::time_point, which doesn't require using templates e...
Definition Realtime.h:82