Statistics
| Branch: | Revision:

napa-baselibs / monl / plugins / corrected_delay_measure.h @ a1a78de4

History | View | Annotate | Download (2 KB)

1
/***************************************************************************
2
 *   Copyright (C) 2009 by Robert Birke
3
 *   robert.birke@polito.it
4
 *
5
 * This library is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU Lesser General Public
7
 * License as published by the Free Software Foundation; either
8
 * version 2.1 of the License, or (at your option) any later version.
9

10
 * This library is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 * Lesser General Public License for more details.
14

15
 * You should have received a copy of the GNU Lesser General Public
16
 * License along with this library; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
18
 ***********************************************************************/
19
#ifndef _CORRECTED_DELAY_MEASURE_H_
20
#define _CORRECTED_DELAY_MEASURE_H_
21

    
22
#include "measure_plugin.h"
23
#include "mon_measure.h"
24
#include <fstream>
25

    
26
/* Debug */
27
//#define D_CORRECTED_DELAY_OUTPUT
28

    
29
class CorrecteddelayMeasure : public MonMeasure {
30

    
31
        MonMeasure *mClockdrift;
32
/* Debug */
33
#ifdef D_CORRECTED_DELAY_OUTPUT
34
        std::fstream output_file;
35
#endif
36
public:
37
        CorrecteddelayMeasure(class MeasurePlugin *m, MeasurementCapabilities mc, class MeasureDispatcher *md);
38
        virtual ~CorrecteddelayMeasure();
39
        virtual result RxPkt(result *r, ExecutionList *el);
40
        virtual result RxData(result *r, ExecutionList *el);
41
        virtual void stop();
42
        virtual void init();
43
};
44

    
45
class CorrecteddelayMeasurePlugin : public MeasurePlugin {
46
        virtual ~CorrecteddelayMeasurePlugin() {};
47

    
48
        virtual MeasurementCapabilities getCaps() {
49
                return IN_BAND | PACKET | DATA | TXRXUNI;
50
        };
51

    
52

    
53
        virtual MonMeasure* createMeasure (MeasurementCapabilities mc, class MeasureDispatcher *md) {
54
                return new CorrecteddelayMeasure(this, mc, md);
55
        };
56
public:
57
        CorrecteddelayMeasurePlugin();
58
};
59

    
60
#endif /* _CORRECTED_DELAY_MEASURE_H_ */
61