A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
frame-capture-model.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
7 */
8
10
11#include "ns3/nstime.h"
12#include "ns3/simulator.h"
13
14namespace ns3
15{
16
17NS_OBJECT_ENSURE_REGISTERED(FrameCaptureModel);
18
19TypeId
21{
22 static TypeId tid = TypeId("ns3::FrameCaptureModel")
24 .SetGroupName("Wifi")
25 .AddAttribute("CaptureWindow",
26 "The duration of the capture window.",
30 return tid;
31}
32
33bool
34FrameCaptureModel::IsInCaptureWindow(Time timePreambleDetected) const
35{
36 return (timePreambleDetected + m_captureWindow >= Simulator::Now());
37}
38
39} // namespace ns3
virtual bool IsInCaptureWindow(Time timePreambleDetected) const
This method returns true if the capture window duration has not elapsed yet, false otherwise.
Time m_captureWindow
Capture window duration.
static TypeId GetTypeId()
Get the type ID.
A base class which provides memory management and object aggregation.
Definition object.h:78
static Time Now()
Return the current simulation virtual time.
Definition simulator.cc:197
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
AttributeValue implementation for Time.
Definition nstime.h:1395
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition nstime.h:1396
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Definition nstime.h:1416
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1332
Every class exported by the ns3 library is enclosed in the ns3 namespace.