Namespaces

Enumerations

enum DecimalPrefix
Name Value
Nano 0
Micro 1
Milli 2
Centi 3
Deci 4
Kilo 5
Mega 6
Giga 7

Decimal prefixes that can be used with most Units.

Defined at line 32 of file ../../sdk/lib/power/state_recorder/cpp/numeric_state_recorder.h

enum SwitchState
Name Value
kOff 0
kOn 1

Defined at line 75 of file ../../sdk/lib/power/state_recorder/cpp/tests/state_recorder_test.cc

Records

Functions

  • std::vector<int64_t> GetTimestamps (const inspect::Hierarchy * history_hierarchy, size_t count)

    Extracts timestamps from a "history" hierarchy.

    Defined at line 32 of file ../../sdk/lib/power/state_recorder/cpp/tests/state_recorder_test.cc

  • int64_t GetCurrentTimestamp (bool lazy_record)

    Returns the current timestamp in nanoseconds, clamped to millisecond resolution if `lazy_record`

    is true.

    Defined at line 45 of file ../../sdk/lib/power/state_recorder/cpp/tests/state_recorder_test.cc

Concepts

template <typename T> WidensToUint32 std::is_same_v<T, _Bool> || std::is_same_v<T, uint8_t> || std::is_same_v<T, uint16_t> || std::is_same_v<T, uint32_t>

The concepts below, combined with a few natural types, specify the numeric types that can be

used with NumericStateRecorder and how they are recorded to trace and Inspect.

| Concept | Trace type | Inspect type |

|----------------|------------|--------------|

| WidensToUint32 | uint32_t | uint64_t |

| uint64_t | uint64_t | uint64_t |

| WidensToInt32 | int32_t | int64_t |

| int64_t | int64_t | int64_t |

| WidensToDouble | double | double |

Defined at line 22 of file ../../sdk/lib/power/state_recorder/cpp/concepts.h

template <typename T> WidensToUint64 WidensToUint32<T> || std::is_same_v<T, uint64_t>

Defined at line 26 of file ../../sdk/lib/power/state_recorder/cpp/concepts.h

template <typename T> WidensToInt32 std::is_same_v<T, int8_t> || std::is_same_v<T, int16_t> || std::is_same_v<T, int32_t>

Defined at line 29 of file ../../sdk/lib/power/state_recorder/cpp/concepts.h

template <typename T> WidensToInt64 WidensToInt32<T> || std::is_same_v<T, int64_t>

Defined at line 33 of file ../../sdk/lib/power/state_recorder/cpp/concepts.h

template <typename T> WidensToDouble std::is_same_v<T, float> || std::is_same_v<T, double>

Defined at line 36 of file ../../sdk/lib/power/state_recorder/cpp/concepts.h

template <typename T> IsRecordableNumericType WidensToUint64<T> || WidensToInt64<T> || WidensToDouble<T>

Defined at line 39 of file ../../sdk/lib/power/state_recorder/cpp/concepts.h

template <typename T> IsRecordableEnumType std::is_enum_v<T> && (WidensToUint64<std::underlying_type_t<T> > || WidensToInt64<std::underlying_type_t<T> >)

An enum type is recordable if it can be mapped in an obvious way to Inspect.

Defined at line 43 of file ../../sdk/lib/power/state_recorder/cpp/concepts.h

template <typename T> IsRecordableValueType IsRecordableNumericType<T> || IsRecordableEnumType<T>

Defined at line 47 of file ../../sdk/lib/power/state_recorder/cpp/concepts.h