Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mrp] Inline ReliableMessageContext getters and setters #13865

Merged
merged 1 commit into from
Jan 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 0 additions & 55 deletions src/messaging/ReliableMessageContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,56 +41,6 @@ namespace Messaging {

ReliableMessageContext::ReliableMessageContext() : mNextAckTime(0), mPendingPeerAckMessageCounter(0) {}

bool ReliableMessageContext::AutoRequestAck() const
{
return mFlags.Has(Flags::kFlagAutoRequestAck);
}

bool ReliableMessageContext::IsAckPending() const
{
return mFlags.Has(Flags::kFlagAckPending);
}

bool ReliableMessageContext::HasRcvdMsgFromPeer() const
{
return mFlags.Has(Flags::kFlagMsgRcvdFromPeer);
}

void ReliableMessageContext::SetAutoRequestAck(bool autoReqAck)
{
mFlags.Set(Flags::kFlagAutoRequestAck, autoReqAck);
}

void ReliableMessageContext::SetMsgRcvdFromPeer(bool inMsgRcvdFromPeer)
{
mFlags.Set(Flags::kFlagMsgRcvdFromPeer, inMsgRcvdFromPeer);
}

void ReliableMessageContext::SetAckPending(bool inAckPending)
{
mFlags.Set(Flags::kFlagAckPending, inAckPending);
}

void ReliableMessageContext::SetDropAckDebug(bool inDropAckDebug)
{
mFlags.Set(Flags::kFlagDropAckDebug, inDropAckDebug);
}

bool ReliableMessageContext::IsMessageNotAcked() const
{
return mFlags.Has(Flags::kFlagMesageNotAcked);
}

void ReliableMessageContext::SetMessageNotAcked(bool messageNotAcked)
{
mFlags.Set(Flags::kFlagMesageNotAcked, messageNotAcked);
}

bool ReliableMessageContext::ShouldDropAckDebug() const
{
return mFlags.Has(Flags::kFlagDropAckDebug);
}

ExchangeContext * ReliableMessageContext::GetExchangeContext()
{
return static_cast<ExchangeContext *>(this);
Expand Down Expand Up @@ -121,11 +71,6 @@ CHIP_ERROR ReliableMessageContext::FlushAcks()
return err;
}

bool ReliableMessageContext::HasPiggybackAckPending() const
{
return mFlags.Has(Flags::kFlagAckMessageCounterIsValid);
}

/**
* Process received Ack. Remove the corresponding message context from the RetransTable and execute the application
* callback
Expand Down
55 changes: 55 additions & 0 deletions src/messaging/ReliableMessageContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,5 +228,60 @@ class ReliableMessageContext
uint32_t mPendingPeerAckMessageCounter;
};

inline bool ReliableMessageContext::AutoRequestAck() const
{
return mFlags.Has(Flags::kFlagAutoRequestAck);
}

inline bool ReliableMessageContext::IsAckPending() const
{
return mFlags.Has(Flags::kFlagAckPending);
}

inline bool ReliableMessageContext::HasRcvdMsgFromPeer() const
{
return mFlags.Has(Flags::kFlagMsgRcvdFromPeer);
}

inline bool ReliableMessageContext::IsMessageNotAcked() const
{
return mFlags.Has(Flags::kFlagMesageNotAcked);
}

inline bool ReliableMessageContext::ShouldDropAckDebug() const
{
return mFlags.Has(Flags::kFlagDropAckDebug);
}

inline bool ReliableMessageContext::HasPiggybackAckPending() const
{
return mFlags.Has(Flags::kFlagAckMessageCounterIsValid);
}

inline void ReliableMessageContext::SetAutoRequestAck(bool autoReqAck)
{
mFlags.Set(Flags::kFlagAutoRequestAck, autoReqAck);
}

inline void ReliableMessageContext::SetMsgRcvdFromPeer(bool inMsgRcvdFromPeer)
{
mFlags.Set(Flags::kFlagMsgRcvdFromPeer, inMsgRcvdFromPeer);
}

inline void ReliableMessageContext::SetAckPending(bool inAckPending)
{
mFlags.Set(Flags::kFlagAckPending, inAckPending);
}

inline void ReliableMessageContext::SetDropAckDebug(bool inDropAckDebug)
{
mFlags.Set(Flags::kFlagDropAckDebug, inDropAckDebug);
}

inline void ReliableMessageContext::SetMessageNotAcked(bool messageNotAcked)
{
mFlags.Set(Flags::kFlagMesageNotAcked, messageNotAcked);
}

} // namespace Messaging
} // namespace chip