AntHocNet 2.0.0
Paper-faithful ant-colony ad hoc routing: the shared core and its adapters
Loading...
Searching...
No Matches
anthocnet::core::AntHistoryTracker Class Reference

#include <anthocnet/core/ant_history.h>

Public Member Functions

 AntHistoryTracker (std::size_t maxEntries)
 maxEntries == 0 means unbounded.
 
bool record (NodeAddress src, std::uint32_t seqNum)
 Record (src, seq).
 
bool seen (NodeAddress src, std::uint32_t seqNum) const
 Read-only membership test.
 
std::size_t size () const
 
void clear ()
 

Detailed Description

Definition at line 27 of file ant_history.h.

Constructor & Destructor Documentation

◆ AntHistoryTracker()

anthocnet::core::AntHistoryTracker::AntHistoryTracker ( std::size_t  maxEntries)
inlineexplicit

maxEntries == 0 means unbounded.

Definition at line 30 of file ant_history.h.

Member Function Documentation

◆ record()

bool anthocnet::core::AntHistoryTracker::record ( NodeAddress  src,
std::uint32_t  seqNum 
)

Record (src, seq).

Returns true if it was new, false if already seen (i.e. a looping/duplicate ant that should be dropped).

◆ seen()

bool anthocnet::core::AntHistoryTracker::seen ( NodeAddress  src,
std::uint32_t  seqNum 
) const

Read-only membership test.

◆ size()

std::size_t anthocnet::core::AntHistoryTracker::size ( ) const
inline

Definition at line 39 of file ant_history.h.

◆ clear()

void anthocnet::core::AntHistoryTracker::clear ( )

The documentation for this class was generated from the following file: