vrq
/usr/src/RPM/BUILD/vrq-1.0.96/src/cnet.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  *         cnet.hpp
00025  *              - class definition of net
00026  *                definition nodes
00027  *
00028  ******************************************************************************
00029  */
00030 
00031 #ifndef CNET_HPP
00032 #define CNET_HPP
00033 
00034 #include <stdio.h>
00035 #include "glue.h"
00036 #include "cdecl.h"
00037 #include "cnode.h"
00038 #include "cportdir.h"
00039 
00040 
00041 class CNode;
00042 
00046 class CNet: public CDecl
00047 {
00048 private:
00049         CNode*  delay;          
00050         CPortDir* portdir;      
00051         int     scalared;       
00052         int     vectored;       
00053         int     undefined;      
00054         StrengthPair_t strength;
00055 public:
00064         CNet( CSymbol* symbol, Coord_t* aLoc, Wire_t wireType, 
00065               CDataType* dataType, int undefined );
00071         virtual CDecl* Clone( CObstack* heap );
00076         void    PortDir( CPortDir* p ) { portdir = p; }
00081         CPortDir* PortDir() { return portdir; }
00086         void    SetDelay( CNode* aExp ) { delay = aExp; }
00091         CNode*  GetDelay( void ) { return delay; }
00096         int     GetUndefined( void ) { return undefined; }
00101         void    SetUndefined( int value ) { undefined = value; }
00106         StrengthPair_t GetStrength() { return strength; }
00111         void    SetStrength( StrengthPair_t s ) { strength = s; }
00116         virtual void SetVectored( int v ) { vectored = v; }
00121         virtual int  GetVectored() { return vectored; }
00126         virtual void SetScalared( int v ) { scalared = v; }
00131         virtual int  GetScalared() { return scalared; }
00136         virtual void Dump( FILE* f );
00140         virtual void PreVisit1( int (*func)(CNode*,void*), void* data );
00141         virtual void PostVisit1( void (*func)(CNode*, void*), void* data );
00142         virtual void PostSubVisit1( CNode* (*func)(CNode*, void*), void* data );
00146 protected:
00152         void Copy( CObstack* heap, const CNet& net );
00153 private:
00154         /*
00155          * disable copy constructor
00156          */
00157         CNet( const CNet& net );
00158 };
00159 
00160 
00161 #endif // CNET_HPP