sc_name_gen.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002 
00003   The following code is derived, directly or indirectly, from the SystemC
00004   source code Copyright (c) 1996-2006 by all Contributors.
00005   All Rights reserved.
00006 
00007   The contents of this file are subject to the restrictions and limitations
00008   set forth in the SystemC Open Source License Version 2.4 (the "License");
00009   You may not use this file except in compliance with such restrictions and
00010   limitations. You may obtain instructions on how to receive a copy of the
00011   License at http://www.systemc.org/. Software distributed by Contributors
00012   under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
00013   ANY KIND, either express or implied. See the License for the specific
00014   language governing rights and limitations under the License.
00015 
00016  *****************************************************************************/
00017 
00018 /*****************************************************************************
00019 
00020   sc_name_gen.h -- Unique name generator.
00021 
00022   Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21
00023 
00024  *****************************************************************************/
00025 
00026 /*****************************************************************************
00027 
00028   MODIFICATION LOG - modifiers, enter your name, affiliation, date and
00029   changes you are making here.
00030 
00031       Name, Affiliation, Date:
00032   Description of Modification:
00033 
00034  *****************************************************************************/
00035 
00036 // $Log: sc_name_gen.h,v $
00037 // Revision 1.1.1.1  2006/12/15 20:31:37  acg
00038 // SystemC 2.2
00039 //
00040 // Revision 1.3  2006/01/13 18:44:30  acg
00041 // Added $Log to record CVS changes into the source.
00042 //
00043 
00044 #ifndef SC_NAME_GEN
00045 #define SC_NAME_GEN
00046 
00047 
00048 #include <cstdio>
00049 
00050 #include "sysc/utils/sc_hash.h"
00051 
00052 namespace sc_core{
00053 
00054 // ----------------------------------------------------------------------------
00055 //  CLASS : sc_name_gen
00056 //
00057 //  Unique name generator class.
00058 // ----------------------------------------------------------------------------
00059 
00060 class sc_name_gen
00061 {
00062 public:
00063 
00064     sc_name_gen();
00065     ~sc_name_gen();
00066 
00067     const char* gen_unique_name( const char* basename_, 
00068                                  bool preserve_first = false 
00069                                );
00070 
00071 private:
00072 
00073     sc_strhash<int*> m_unique_name_map;
00074     char             m_unique_name[BUFSIZ];
00075 
00076 private:
00077 
00078     // disabled
00079     sc_name_gen( const sc_name_gen& );
00080     sc_name_gen& operator = ( const sc_name_gen& );
00081 };
00082 
00083 } // namespace sc_core
00084 
00085 #endif
00086 
00087 // Taf!

Generated on Wed Jan 21 15:32:09 2009 for SystemC by  doxygen 1.5.5