vrq
/usr/src/RPM/BUILD/vrq-1.0.96/src/cport.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Copyright (C) 1997-2007, Mark Hummel
00003  * This file is part of Vrq.
00004  *
00005  * Vrq is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * Vrq is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public
00016  * License along with this library; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, 
00018  * Boston, MA  02110-1301  USA
00019  *****************************************************************************
00020  */
00021 /******************************************************************************
00022  *
00023  *
00024  *         cport.hpp
00025  *              - class definition of port
00026  *                definition nodes
00027  *
00028  ******************************************************************************
00029  */
00030 
00031 #ifndef CPORT_HPP
00032 #define CPORT_HPP
00033 
00034 #include <stdio.h>
00035 #include "glue.h"
00036 #include "cdecl.h"
00037 
00038 
00039 class CNode;
00040 
00044 class CPort : public CDecl
00045 {
00046 private:
00047         CNode*  connection;     
00048         int     dotted;         
00049         Decl_t  direction;      
00050 public:
00057         CPort( CSymbol* symbol, int dotted, Coord_t* aLoc );
00063         virtual CDecl* Clone( CObstack* heap );
00068         virtual void Dump( FILE* f );
00073         CNode* GetConnection( void );
00078         void SetConnection( CNode* decl );
00083         int IsDotted( void ){ return dotted; };
00088         void   Direction( Decl_t d ) { direction = d; }
00093         Decl_t Direction() { return direction; }
00098         void    PreVisit1( int (*func)(CNode*,void*), void* data );
00099         void    PostVisit1( void (*func)(CNode*, void*), void* data );
00100         void    PostSubVisit1( CNode* (*func)(CNode*, void*), void* data );
00101 protected:
00105         virtual INT32 GetWidth( void ) { MASSERT( FALSE ); }
00106         virtual CNode* GetWidthExp( void ) { MASSERT( FALSE ); } 
00110         void Copy( CObstack* heap, const CPort& port );
00111 private:
00112         /*
00113          * Disable copy constructor.
00114          */
00115         CPort( const CPort& port );
00119 };
00120 
00121 #endif // CPORT_HPP