libptpmgmt  1.4
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 
70 {
71  private:
72  std::unique_ptr<BaseMngTlv> m_tlv;
73  Message &m_msg;
75  public:
80  MessageBuilder(Message &msg) : m_msg(msg) {}
85  Message &getMsg() { return m_msg; }
89  void clear() { m_msg.clearData(); m_tlv.reset(); }
100  bool buildTlv(actionField_e actionField, mng_vals_e tlv_id);
101 };
102 
103 __PTPMGMT_NAMESPACE_END
104 #else /* __cplusplus */
105 #include "c/msgCall.h"
106 #endif /* __cplusplus */
107 
108 #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:574
Dispacher for management TLV.
Definition: callDef.h:34
Build TLV to send a PTP management message.
Definition: msgCall.h:70
Message & getMsg()
Definition: msgCall.h:85
MessageBuilder(Message &msg)
Definition: msgCall.h:80
bool buildTlv(actionField_e actionField, mng_vals_e tlv_id)
void clear()
Definition: msgCall.h:89
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