Project

General

Profile

Statistics
| Branch: | Revision:

root / src / scave / diffquot.h @ c87b95b0

History | View | Annotate | Download (1.47 KB)

1
//=========================================================================
2
//  DIFFQUOT.H - part of
3
//                  OMNeT++/OMNEST
4
//           Discrete System Simulation in C++
5
//
6
//  Author: Andras Varga
7
//
8
//=========================================================================
9

    
10
/*--------------------------------------------------------------*
11
  Copyright (C) 2005-2008 Andras Varga
12

13
  This file is distributed WITHOUT ANY WARRANTY. See the file
14
  `license' for details on this and other legal matters.
15
*--------------------------------------------------------------*/
16

    
17
#ifndef _DIFFQUOT_H_
18
#define _DIFFQUOT_H_
19

    
20
#include "commonnodes.h"
21

    
22
NAMESPACE_BEGIN
23

    
24

    
25
/**
26
 * Processing node which calculates difference quotient of every value
27
 * and the next one.
28
 */
29
class SCAVE_API DifferenceQuotientNode : public FilterNode
30
{
31
    private:
32
        bool firstRead;
33
        Datum l;
34
    public:
35
        DifferenceQuotientNode();
36
        virtual bool isReady() const;
37
        virtual void process();
38
};
39

    
40
class SCAVE_API DifferenceQuotientNodeType : public FilterNodeType
41
{
42
    public:
43
        virtual const char *getName() const {return "diffquot";}
44
        virtual const char *getDescription() const;
45
        virtual void getAttributes(StringMap& attrs) const;
46
        virtual void getAttrDefaults(StringMap& attrs) const;
47
        virtual Node *create(DataflowManager *mgr, StringMap& attrs) const;
48
        virtual void mapVectorAttributes(/*inout*/StringMap &attrs) const;
49
};
50

    
51
NAMESPACE_END
52

    
53

    
54
#endif
55

    
56