DESERT 4.0.0
uwtdma-frame.h
Go to the documentation of this file.
1//
2// Copyright (c) 2017 Regents of the SIGNET lab, University of Padova.
3// All rights reserved.
4//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions
7// are met:
8// 1. Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10// 2. Redistributions in binary form must reproduce the above copyright
11// notice, this list of conditions and the following disclaimer in the
12// documentation and/or other materials provided with the distribution.
13// 3. Neither the name of the University of Padova (SIGNET lab) nor the
14// names of its contributors may be used to endorse or promote products
15// derived from this software without specific prior written permission.
16//
17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28//
29
39#ifndef UWTDMA_FRAME_H
40#define UWTDMA_FRAME_H
41
42#include <assert.h>
43#include <fstream>
44#include <iostream>
45#include <map>
46#include <queue>
47#include <sstream>
48#include <sys/time.h>
49#include <uwtdma.h>
50#include <vector>
51
52typedef std::map<int, int> Slot;
53typedef std::map<int, Slot> SlotTopology;
54
55class UwTDMA_frame;
56
60class UwTDMA_frame : public UwTDMA
61{
62
63 friend class UwTDMATimer;
64
65public:
70
74 virtual ~UwTDMA_frame();
75
76protected:
86 virtual int command(int argc, const char *const *argv);
87
91 virtual void changeStatus();
92
97 virtual void initializeTopologyS();
98
99 Slot::iterator getCurrentSlot();
100 Slot::iterator getNextMySlot(int skip = 0);
101
115private:
120};
121
122#endif
Definition uwtdma.h:63
Definition uwtdma-frame.h:61
Slot::iterator getCurrentSlot()
Definition uwtdma-frame.cpp:194
virtual void changeStatus()
Definition uwtdma-frame.cpp:100
SlotTopology s_
Definition uwtdma-frame.h:109
virtual ~UwTDMA_frame()
Definition uwtdma-frame.cpp:95
int topology_index
Definition uwtdma-frame.h:105
string topology_S_file_name_
Definition uwtdma-frame.h:116
virtual void initializeTopologyS()
Definition uwtdma-frame.cpp:222
char topology_S_token_separator_
Definition uwtdma-frame.h:117
UwTDMA_frame()
Definition uwtdma-frame.cpp:80
Slot::iterator getNextMySlot(int skip=0)
Definition uwtdma-frame.cpp:209
int tot_nodes
Definition uwtdma-frame.h:104
int my_slots_counter
Definition uwtdma-frame.h:102
Slot my_slot_numbers_
Definition uwtdma-frame.h:111
int max_packet_per_slot
Definition uwtdma-frame.h:106
virtual int command(int argc, const char *const *argv)
Definition uwtdma-frame.cpp:132
int packet_sent_curr_slot_
Definition uwtdma-frame.h:107
Definition uwtdma.h:90
std::map< int, int > Slot
Definition uwtdma-frame.h:52
std::map< int, Slot > SlotTopology
Definition uwtdma-frame.h:53
Provides the definition of the class UWTDMA.