Skip to content

const_cast can be removed now that cmatchexpression::matches is const #14

@edlongman

Description

@edlongman

bool PacketFilter::matches(const cPacket *cpacket) const
{
MatchableObject matchableObject(MatchableObject::ATTRIBUTE_FULLNAME, cpacket);
// TODO: eliminate const_cast when cMatchExpression::matches becomes const
if (!const_cast<PacketFilter *>(this)->packetMatchExpression.matches(&matchableObject))
return false;
else if (auto packet = dynamic_cast<const Packet *>(cpacket)) {
PacketDissectorCallback callback(*this);
return callback.matches(packet);
}
else

There may be other locations too

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions