Project

General

Profile

Statistics
| Branch: | Revision:

root / src / scave / xyplotnode.h @ cbd2c699

History | View | Annotate | Download (2.06 KB)

1 01873262 Georg Kunz
//=========================================================================
2
//  XYPLOTNODE.H - part of
3
//                  OMNeT++/OMNEST
4
//           Discrete System Simulation in C++
5
//
6
//  Author: Andras Varga
7
//
8
//=========================================================================
9
10
/*--------------------------------------------------------------*
11
  Copyright (C) 1992-2008 Andras Varga
12
  Copyright (C) 2006-2008 OpenSim Ltd.
13

14
  This file is distributed WITHOUT ANY WARRANTY. See the file
15
  `license' for details on this and other legal matters.
16
*--------------------------------------------------------------*/
17
18
#ifndef _XYPLOTNODE_H_
19
#define _XYPLOTNODE_H_
20
21
#include "commonnodes.h"
22
23
#include <vector>
24
#include "node.h"
25
#include "nodetype.h"
26
27
NAMESPACE_BEGIN
28
29
30
/**
31
 * Creates x-y plot. Has one "x" and several "y" input ports. Values of these
32
 * ports are grouped by time -- when (t,x) and (t',y) arrive where t==t', it
33
 * outputs (x,y). (The t, t' times do not appear in the output).
34
 *
35
 * Note: the output will *not* be ordered by x, so one should be very cautious
36
 * with further processing. Connecting an ArrayBuilder is fine.
37
 */
38
class SCAVE_API XYPlotNode : public Node
39
{
40
    public:
41
        typedef std::vector<Port> PortVector;
42
        Port xin;
43
        PortVector yin;
44
        PortVector out;
45
    public:
46
        XYPlotNode() : xin(this) {}
47
        virtual ~XYPlotNode() {}
48
49
        Port *getPortY(int k);
50
        Port *getPortOut(int k);
51
52
        virtual bool isReady() const;
53
        virtual void process();
54
        virtual bool isFinished() const;
55
};
56
57
class SCAVE_API XYPlotNodeType : public NodeType
58
{
59
    public:
60
        virtual const char *getName() const {return "xyplot";}
61
        virtual const char *getCategory() const {return "merger";}
62
        virtual const char *getDescription() const;
63
        virtual bool isHidden() const {return true;}
64
        virtual void getAttributes(StringMap& attrs) const;
65
        virtual Node *create(DataflowManager *mgr, StringMap& attrs) const;
66
        virtual Port *getPort(Node *node, const char *portname) const;
67
};
68
69
NAMESPACE_END
70
71
72
#endif
73
74