srVisitor.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // srVisitor.h
00004 //
00005 // This file contains the definition of the srVisitor and srVisitorMgr classes.
00006 //
00007 // srVisitor
00008 //      srVisitor defines the visitor interface class for the sr classes. The
00009 //      application can derive this interface to implement a specific operation
00010 //      on each of the concrete sr classes.
00011 //
00012 // srVisitorMgr
00013 //      srVisitorMgr implements a manager for the visitor classes. This class
00014 //      needs to be created and initialized by the application by registering
00015 //      a derived visitor for each application defined schema representation
00016 //      classes within an sdNameSpace.
00017 //
00018 // *****************************************************************************
00019 // Except as specified in the OpenAccess terms of use of Cadence or Silicon
00020 // Integration Initiative, this material may not be copied, modified,
00021 // re-published, uploaded, executed, or distributed in any way, in any medium,
00022 // in whole or in part, without prior written permission from Cadence.
00023 //
00024 //                Copyright 2007-2007 Cadence Design Systems, Inc.
00025 //                           All Rights Reserved.
00026 //
00027 //  $Author: jaideep $
00028 //  $Revision: 1.3 $
00029 //  $Date: 2007/03/09 16:31:27 $
00030 //  $State: Exp $
00031 // *****************************************************************************
00032 // *****************************************************************************
00033 
00034 
00035 
00036 #if !defined(srVisitor_P)
00037 #define srVisitor_P
00038 
00039 
00040 
00041 // *****************************************************************************
00042 // Nested includes
00043 // *****************************************************************************
00044 #include "sdNameSpace.h"
00045 #include "srBaseTypes.h"
00046 
00047 
00048 
00049 // *****************************************************************************
00050 // Declare and define types in the Schema namespace.
00051 // *****************************************************************************
00052 BEGIN_SR_NAMESPACE
00053 
00054 
00055 
00056 // *****************************************************************************
00057 // Forward Public Class Declarations
00058 // *****************************************************************************
00059 class srObjectRef;
00060 class srObjectState;
00061 class sr1to1Relationship;
00062 class sr1toNRelationship;
00063 
00064 class srRelationshipBase;
00065 class srAttributeBase;
00066 class srValueBase;
00067 
00068 
00069 
00070 // *****************************************************************************
00071 // srVisitor
00072 // *****************************************************************************
00073 class SR_DLL_API srVisitor {
00074 public:
00075     virtual                 ~srVisitor();
00076 
00077     virtual void            visit(srObjectRef *object) = 0;
00078     virtual void            visit(srObjectState *object) = 0;
00079     virtual void            visit(sr1to1Relationship *object) = 0;
00080     virtual void            visit(sr1toNRelationship *object) = 0;
00081     virtual void            visit(srRelationshipBase *object) = 0;
00082     virtual void            visit(srAttributeBase *object) = 0;
00083     virtual void            visit(srValueBase *object) = 0;
00084 };
00085 
00086 
00087 
00088 // *****************************************************************************
00089 // srVisitorMgr
00090 // *****************************************************************************
00091 class SR_DLL_API srVisitorMgr {
00092 public:
00093                             srVisitorMgr();
00094                             ~srVisitorMgr();
00095 
00096     void                    reset();
00097     void                    addVisitor(const sd::sdNameSpace    *nameSpace,
00098                                        srVisitor                *visitor);
00099 
00100     srVisitor               *getVisitor(const sd::sdNameSpace *nameSpace) const;
00101 
00102 private:
00103     void                    *m_data;
00104 };
00105 
00106 
00107 
00108 END_SR_NAMESPACE
00109 
00110 #endif

Return to top of page