Project

General

Profile

Statistics
| Branch: | Revision:

root / src / scave / teenode.h @ a3be1d55

History | View | Annotate | Download (1.69 KB)

1 01873262 Georg Kunz
//=========================================================================
2
//  TEENODE.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 _TEENODE_H_
19
#define _TEENODE_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
 * Processing node splits an input stream into several output streams.
32
 */
33
class SCAVE_API TeeNode : public Node
34
{
35
    public:
36
        typedef std::vector<Port> PortVector;
37
        Port in;
38
        PortVector outs;
39
    public:
40
        TeeNode() : in(this) {}
41
        virtual ~TeeNode() {}
42
43
        Port *addPort();
44
45
        virtual bool isReady() const;
46
        virtual void process();
47
        virtual bool isFinished() const;
48
};
49
50
class SCAVE_API TeeNodeType : public NodeType
51
{
52
    public:
53
        virtual const char *getName() const {return "tee";}
54
        virtual const char *getCategory() const {return "tee";}
55
        virtual const char *getDescription() const;
56
        virtual bool isHidden() const {return true;}
57
        virtual void getAttributes(StringMap& attrs) const;
58
        virtual Node *create(DataflowManager *mgr, StringMap& attrs) const;
59
        virtual Port *getPort(Node *node, const char *portname) const;
60
};
61
62
NAMESPACE_END
63
64
65
#endif
66
67