1
/*******************************************************************************
2
* This file is part of openWNS (open Wireless Network Simulator)
3
* _____________________________________________________________________________
5
* Copyright (C) 2004-2009
6
* Chair of Communication Networks (ComNets)
7
* Kopernikusstr. 5, D-52074 Aachen, Germany
8
* phone: ++49-241-80-27910,
9
* fax: ++49-241-80-22242
10
* email: info@openwns.org
11
* www: http://www.openwns.org
12
* _____________________________________________________________________________
14
* openWNS is free software; you can redistribute it and/or modify it under the
15
* terms of the GNU Lesser General Public License version 2 as published by the
16
* Free Software Foundation;
18
* openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
19
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
20
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
23
* You should have received a copy of the GNU Lesser General Public License
24
* along with this program. If not, see <http://www.gnu.org/licenses/>.
26
******************************************************************************/
28
#ifndef WIMAC_FRAME_TIMINGCONTROL_H
29
#define WIMAC_FRAME_TIMINGCONTROL_H
31
#include <WNS/ldk/ldk.hpp>
32
#include <WNS/ldk/fcf/TimingControl.hpp>
33
#include <WNS/events/CanTimeout.hpp>
38
NAMESPACE_BEGIN(pyconfig)
48
class CompoundCollectorInterface;
54
NAMESPACE_BEGIN(wimac)
55
NAMESPACE_BEGIN(frame)
58
* @brief WiMAC specific Timing Control.
60
* The Timing Control of the WiMAC module introduces abstract Activations
61
* to the Frame Configuration Framework. Each CompoundCollector is activated
62
* by three different types of Activations (Start, StartCollection, FinishCollection).
63
* The Activations specify the concrete action the CompoundCollector has to perform.
64
* The chronologically ordered list of Activations is created from (/defined by) the PyConig file.
67
public virtual wns::ldk::fcf::TimingControlInterface,
68
public wns::events::PeriodicTimeout,
69
public wns::events::CanTimeout
80
TimingControl( wns::ldk::fcf::FrameBuilder* fb, const wns::pyconfig::View& config );
82
/// Inherited from TiminControlInterface
88
void finishedPhase( wns::ldk::fcf::CompoundCollectorInterface* collector );
89
wns::ldk::fcf::FrameBuilder* getFrameBuilder() const
95
/// Inherited from PeriodicTimeout
98
/// Inherited from CanTimeout
104
struct ActivationEntry
106
wns::ldk::fcf::CompoundCollectorInterface* compoundCollector;
111
typedef std::list<ActivationEntry> Activations;
113
void startProcessingActivations();
114
void processOneActivation();
116
/// cronologically ordered list of activations.
117
/// For the modes sending and receiving a CompoundCollector has three
118
/// Activations: startCollection, finishCollection, start
119
/// For the mode pause only one activation is valid: pause
120
Activations activations_;
121
/// iterator through activations
122
Activations::const_iterator activeCC_;
124
/// iterator is used for validation only ( assure(timeoutIsForMe == activeCC_, ...) )
125
//Activations::const_iterator timeoutIsForMe;
127
wns::ldk::fcf::FrameBuilder* frameBuilder_;
130
wns::pyconfig::View config_;
132
simTimeType frameStartupDelay_;
134
friend class TriggerActivationStart;