1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef META_INTERFACE_ICLOCK_H
17 #define META_INTERFACE_ICLOCK_H
18 
19 #include <cstdint>
20 
21 #include <core/plugin/intf_interface.h>
22 
23 #include <meta/base/interface_macros.h>
24 #include <meta/base/namespace.h>
25 #include <meta/base/shared_ptr.h>
26 #include <meta/base/time_span.h>
27 #include <meta/base/types.h>
28 
29 META_BEGIN_NAMESPACE()
30 
31 META_REGISTER_INTERFACE(IClock, "a3021cdd-379e-45aa-ab0a-4d89e8657d0f")
32 
33 /**
34  * @brief Interface to get current time (current time of specific clock).
35  */
36 class IClock : public CORE_NS::IInterface {
37     META_INTERFACE(CORE_NS::IInterface, IClock)
38 public:
39     /**
40      * @brief Get current time.
41      */
42     virtual TimeSpan GetTime() const = 0;
43 };
44 
45 META_END_NAMESPACE()
46 
47 #endif
48