libptpmgmt  1.3
libptpmgmt library that provides the functionality of linuxptp pmc
msgCall.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-3.0-or-later
2  SPDX-FileCopyrightText: Copyright © 2022 Erez Geva <ErezGeva2@gmail.com> */
3 
11 #ifndef __PTPMGMT_MSG_CALL_H
12 #define __PTPMGMT_MSG_CALL_H
13 
14 #ifdef __cplusplus
15 #include "callDef.h"
16 
17 __PTPMGMT_NAMESPACE_BEGIN
18 
27 {
28  public:
32  MessageDispatcher() = default;
37  void callHadler(const Message &msg);
45  void callHadler(const Message &msg, mng_vals_e tlv_id,
46  const BaseMngTlv *tlv);
52  virtual void noTlv(const Message &msg) {}
59  virtual void noTlvCallBack(const Message &msg, const char *idStr) {}
60 };
61 
75 {
76  private:
77  std::unique_ptr<BaseMngTlv> m_tlv;
78  Message &m_msg;
80  public:
85  MessageBuilder(Message &msg) : m_msg(msg) {}
90  Message &getMsg() { return m_msg; }
94  void clear() { m_msg.clearData(); m_tlv.reset(); }
105  bool buildTlv(actionField_e actionField, mng_vals_e tlv_id);
106 };
107 
108 __PTPMGMT_NAMESPACE_END
109 #else /* __cplusplus */
110 #include "c/msgCall.h"
111 #endif /* __cplusplus */
112 
113 #endif /* __PTPMGMT_MSG_CALL_H */
Base classes with callbacks for message dispacher classes.
Messages dispatcher for C.
Builder for a management TLV.
Definition: callDef.h:573
Dispacher for management TLV.
Definition: callDef.h:34
Build TLV to send a PTP management message.
Definition: msgCall.h:75
Message & getMsg()
Definition: msgCall.h:90
MessageBuilder(Message &msg)
Definition: msgCall.h:85
bool buildTlv(actionField_e actionField, mng_vals_e tlv_id)
void clear()
Definition: msgCall.h:94
Dispatch received PTP management message TLV.
Definition: msgCall.h:27
void callHadler(const Message &msg)
virtual void noTlvCallBack(const Message &msg, const char *idStr)
Definition: msgCall.h:59
MessageDispatcher()=default
void callHadler(const Message &msg, mng_vals_e tlv_id, const BaseMngTlv *tlv)
virtual void noTlv(const Message &msg)
Definition: msgCall.h:52
Handle PTP management message.
Definition: msg.h:58
void clearData()
mng_vals_e
Management TLVs ID.
Definition: mngIds.h:29
Definition: types.h:962
actionField_e
Definition: types.h:191