libptpmgmt 2.0
libptpmgmt library that provides the functionality of linuxptp pmc
Loading...
Searching...
No Matches
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 private:
29 /* To improve backward compatibility
30 Call virtual functions in inline functions,
31 so we compile them in the application
32 and avoid using virtual function table in the library */
33 void cNoTlv(const Message &msg) { noTlv(msg); }
34 void cNoTlvCB(const Message &msg, const char *idStr) {
35 noTlvCallBack(msg, idStr);
36 }
37 public:
41 MessageDispatcher() = default;
46 void callHadler(const Message &msg);
54 void callHadler(const Message &msg, mng_vals_e tlv_id,
55 const BaseMngTlv *tlv);
61 virtual void noTlv(const Message &msg) {}
68 virtual void noTlvCallBack(const Message &msg, const char *idStr) {}
69};
70
79{
80 private:
81 std::unique_ptr<BaseMngTlv> m_tlv;
82 Message &m_msg;
84 public:
98 void clear();
109 bool buildTlv(actionField_e actionField, mng_vals_e tlv_id);
110};
111
112__PTPMGMT_NAMESPACE_END
113#else /* __cplusplus */
114#include "c/msgCall.h"
115#endif /* __cplusplus */
116
117#endif /* __PTPMGMT_MSG_CALL_H */
Messages dispatcher and builder for C.
Base classes with callbacks for message dispacher classes.
Builder for a management TLV.
Definition callDef.h:1077
Dispacher for management TLV.
Definition callDef.h:34
Definition msgCall.h:79
MessageBuilder(Message &msg)
bool buildTlv(actionField_e actionField, mng_vals_e tlv_id)
Message & getMsg()
Definition msgCall.h:27
void callHadler(const Message &msg)
virtual void noTlvCallBack(const Message &msg, const char *idStr)
Definition msgCall.h:68
MessageDispatcher()=default
void callHadler(const Message &msg, mng_vals_e tlv_id, const BaseMngTlv *tlv)
virtual void noTlv(const Message &msg)
Definition msgCall.h:61
Handle PTP management message.
Definition msg.h:215
mng_vals_e
Management TLVs ID.
Definition mngIds.h:29
Definition types.h:915
actionField_e
Definition types.h:191