Skip to content

Commit

Permalink
detail: add missing include
Browse files Browse the repository at this point in the history
Fixes building with gcc 15

Change-Id: I14c0583f78096e44e52153654aa175ab0d6747cd
  • Loading branch information
Pesa committed Jan 19, 2025
1 parent d384a53 commit 0ba3d3a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
13 changes: 3 additions & 10 deletions ndn-cxx/detail/packet-base.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2013-2018 Regents of the University of California.
* Copyright (c) 2013-2025 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
Expand Down Expand Up @@ -28,21 +28,14 @@ uint64_t
PacketBase::getCongestionMark() const
{
auto mark = this->getTag<lp::CongestionMarkTag>();

if (mark == nullptr) {
return 0;
}
else {
return *mark;
}
return mark ? *mark : 0;
}

void
PacketBase::setCongestionMark(uint64_t mark)
{
if (mark != 0) {
auto tag = make_shared<lp::CongestionMarkTag>(mark);
this->setTag(std::move(tag));
this->setTag(make_shared<lp::CongestionMarkTag>(mark));
}
else {
this->removeTag<lp::CongestionMarkTag>();
Expand Down
13 changes: 9 additions & 4 deletions ndn-cxx/detail/packet-base.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2013-2022 Regents of the University of California.
* Copyright (c) 2013-2025 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
Expand All @@ -24,19 +24,24 @@

#include "ndn-cxx/detail/tag-host.hpp"

#include <cstdint>

namespace ndn {

/** \brief Base class to allow simple management of packet tags.
/**
* \brief Base class to allow simple management of common packet tags.
*/
class PacketBase : public TagHost
{
public:
/** \brief Get the value of the CongestionMark tag.
/**
* \brief Get the value of the CongestionMark tag.
*/
uint64_t
getCongestionMark() const;

/** \brief Set the CongestionMark tag to the specified value.
/**
* \brief Set the CongestionMark tag to the specified value.
*/
void
setCongestionMark(uint64_t mark);
Expand Down

0 comments on commit 0ba3d3a

Please sign in to comment.