clkmgr 2.0
Clock Manager API library to receive events from the PTP service
Loading...
Searching...
No Matches
subscription.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 SPDX-FileCopyrightText: Copyright © 2024 Intel Corporation. */
3
12#ifndef CLKMGR_SUBSCRIPTION_H
13#define CLKMGR_SUBSCRIPTION_H
14
15#include "pub/clkmgr/utility.h"
16#include "pub/clkmgr/types.h"
17#include <array>
18
20
26{
27 public:
28 ClockSubscriptionBase() = default;
29
30 virtual ~ClockSubscriptionBase();
31
39 virtual bool setEventMask(uint32_t newEventMask);
40
45 uint32_t getEventMask() const;
46
52 void setClockOffsetThreshold(uint32_t threshold);
53
58 uint32_t getClockOffsetThreshold() const;
59
60 protected:
65 void modifyEventMask(uint32_t newEventMask);
66
67 private:
68 uint32_t clockOffsetThreshold = 0;
69 uint32_t eventMask = 0;
70};
71
77{
78 public:
79 PTPClockSubscription() noexcept;
80
81 ~PTPClockSubscription() override;
82
91 bool setCompositeEventMask(uint32_t composite_event_mask);
92
97 uint32_t getCompositeEventMask() const;
98
108 bool setEventMask(uint32_t newEventMask) override final;
109
110 private:
111 uint32_t m_composite_event_mask = 0;
112};
113
119{
120 public:
121 SysClockSubscription() noexcept;
122
123 ~SysClockSubscription() override;
124
134 bool setEventMask(uint32_t newEventMask) override final;
135};
136
141{
142 public:
144
149
154
160
167
173
178
183
189
196
202
203 private:
204 PTPClockSubscription ptpSubscription;
205 SysClockSubscription sysSubscription;
206 bool ptpSubscribed;
207 bool sysSubscribed;
208};
209
211
212#endif /* CLKMGR_SUBSCRIPTION_H */
Definition subscription.h:26
void modifyEventMask(uint32_t newEventMask)
uint32_t getEventMask() const
virtual bool setEventMask(uint32_t newEventMask)
uint32_t getClockOffsetThreshold() const
void setClockOffsetThreshold(uint32_t threshold)
Definition subscription.h:141
void setSysSubscription(const SysClockSubscription &newSysSub)
const PTPClockSubscription & getPtpSubscription() const
const SysClockSubscription & getSysSubscription() const
bool isSysSubscriptionEnable() const
bool isPTPSubscriptionEnable() const
void setPtpSubscription(const PTPClockSubscription &newPtpSub)
Definition subscription.h:77
uint32_t getCompositeEventMask() const
bool setEventMask(uint32_t newEventMask) override final
bool setCompositeEventMask(uint32_t composite_event_mask)
Definition subscription.h:119
bool setEventMask(uint32_t newEventMask) override final
Enumerator types.
Helper macros.
#define __CLKMGR_NAMESPACE_BEGIN
Definition utility.h:19
#define __CLKMGR_NAMESPACE_END
Definition utility.h:21