cvisitor.h

00001 //==========================================================================
00002 //  CVISITOR.H - part of
00003 //                     OMNeT++/OMNEST
00004 //            Discrete System Simulation in C++
00005 //
00006 //  Declaration of the following classes:
00007 //    cVisitor:  enables traversing the object tree
00008 //
00009 //==========================================================================
00010 
00011 /*--------------------------------------------------------------*
00012   Copyright (C) 1992-2008 Andras Varga
00013   Copyright (C) 2006-2008 OpenSim Ltd.
00014 
00015   This file is distributed WITHOUT ANY WARRANTY. See the file
00016   `license' for details on this and other legal matters.
00017 *--------------------------------------------------------------*/
00018 
00019 #ifndef __CVISITOR_H
00020 #define __CVISITOR_H
00021 
00022 #include "simkerneldefs.h"
00023 
00024 NAMESPACE_BEGIN
00025 
00026 class cObject;
00027 
00028 
00059 class SIM_API cVisitor
00060 {
00061   protected:
00065      class EndTraversalException { public: EndTraversalException() {} };
00066 
00067   public:
00071     virtual ~cVisitor() {}
00072 
00078     virtual bool process(cObject *obj);
00079 
00086     virtual bool processChildrenOf(cObject *obj);
00087 
00098     virtual void visit(cObject *obj) = 0;
00099 };
00100 
00101 NAMESPACE_END
00102 
00103 
00104 #endif
00105 
00106 
Generated on Tue Dec 2 11:16:27 2014 for OMNeT++ Simulation Library by  doxygen 1.6.3