OMNeT++ Simulation Library  5.6.1
cvisitor.h
1 //==========================================================================
2 // CVISITOR.H - part of
3 // OMNeT++/OMNEST
4 // Discrete System Simulation in C++
5 //
6 //==========================================================================
7 
8 /*--------------------------------------------------------------*
9  Copyright (C) 1992-2017 Andras Varga
10  Copyright (C) 2006-2017 OpenSim Ltd.
11 
12  This file is distributed WITHOUT ANY WARRANTY. See the file
13  `license' for details on this and other legal matters.
14 *--------------------------------------------------------------*/
15 
16 #ifndef __OMNETPP_CVISITOR_H
17 #define __OMNETPP_CVISITOR_H
18 
19 #include "simkerneldefs.h"
20 
21 namespace omnetpp {
22 
23 class cObject;
24 
25 
56 class SIM_API cVisitor
57 {
58  protected:
63 
64  public:
68  virtual ~cVisitor() {}
69 
75  virtual bool process(cObject *obj);
76 
83  virtual bool processChildrenOf(cObject *obj);
84 
95  virtual void visit(cObject *obj) = 0;
96 };
97 
98 } // namespace omnetpp
99 
100 
101 #endif
102 
103 
Root of the OMNeT++ class hierarchy. cObject is a lightweight class without any data members...
Definition: cobject.h:58
Can be thrown to get out in the middle of the traversal process.
Definition: cvisitor.h:62
Enables traversing the tree of (cObject-rooted) simulation objects.
Definition: cvisitor.h:56
Definition: cabstracthistogram.h:21
virtual ~cVisitor()
Definition: cvisitor.h:68