#include <SafeCTimeAccess.h>
|
bool | getGmtime (const std::time_t &time, std::tm *calendarTime) |
|
bool | getLocaltime (const std::time_t &time, std::tm *calendarTime) |
|
This class allows access safe access to the multithreaded-unsafe time functions. It is a singleton because there needs to be a single lock that protects the time functions. That single lock is contained within this class.
◆ getGmtime()
bool alexaClientSDK::avsCommon::utils::timing::SafeCTimeAccess::getGmtime |
( |
const std::time_t & |
time, |
|
|
std::tm * |
calendarTime |
|
) |
| |
Function to safely call std::gmtime. std::gmtime uses a static internal data structure that is not thread-safe.
- Parameters
-
| time | The time since epoch to convert. |
[out] | time | The output in calendar time, expressed in UTC time. |
- Returns
- true if successful, false otherwise.
◆ getLocaltime()
bool alexaClientSDK::avsCommon::utils::timing::SafeCTimeAccess::getLocaltime |
( |
const std::time_t & |
time, |
|
|
std::tm * |
calendarTime |
|
) |
| |
Function to safely call std::localtime. std::localtime uses a static internal data structure that is not thread-safe.
- Parameters
-
| time | The time since epoch to convert. |
[out] | time | The output in calendar time, expressed in UTC time. |
- Returns
- true if successful, false otherwise.
◆ instance()
static std::shared_ptr<SafeCTimeAccess> alexaClientSDK::avsCommon::utils::timing::SafeCTimeAccess::instance |
( |
| ) |
|
|
static |
The method for accessing the singleton SafeCTimeAccess class. It returns a shared_ptr so classes that depend on this class can keep it alive until they are destroyed.
- Returns
- std::shared_ptr to the singleton SafeCTimeAccess object.
The documentation for this class was generated from the following file:
- /workplace/avs-device-sdk/AVSCommon/Utils/include/AVSCommon/Utils/Timing/SafeCTimeAccess.h
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0