00001 /***************************************************************************** 00002 00003 The following code is derived, directly or indirectly, from the SystemC 00004 source code Copyright (c) 1996-2005 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 #ifndef SC_NAME_GEN 00037 #define SC_NAME_GEN 00038 00039 00040 #include <cstdio> 00041 00042 #include "sysc/utils/sc_hash.h" 00043 00044 namespace sc_core{ 00045 00046 // ---------------------------------------------------------------------------- 00047 // CLASS : sc_name_gen 00048 // 00049 // Unique name generator class. 00050 // ---------------------------------------------------------------------------- 00051 00052 class sc_name_gen 00053 { 00054 public: 00055 00056 sc_name_gen(); 00057 ~sc_name_gen(); 00058 00059 const char* gen_unique_name( const char* basename_, 00060 bool preserve_first = false 00061 ); 00062 00063 private: 00064 00065 sc_strhash<int*> m_unique_name_map; 00066 char m_unique_name[BUFSIZ]; 00067 00068 private: 00069 00070 // disabled 00071 sc_name_gen( const sc_name_gen& ); 00072 sc_name_gen& operator = ( const sc_name_gen& ); 00073 }; 00074 00075 } // namespace sc_core 00076 00077 #endif 00078 00079 // Taf!
1.5.1