00001 /***************************************************************************** 00002 00003 The following code is derived, directly or indirectly, from the SystemC 00004 source code Copyright (c) 1996-2014 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 (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.accellera.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 CHANGE LOG AT THE END OF THE FILE 00025 *****************************************************************************/ 00026 00027 00028 #ifndef SC_NAME_GEN 00029 #define SC_NAME_GEN 00030 00031 00032 #include <cstdio> 00033 00034 #include "sysc/utils/sc_hash.h" 00035 00036 namespace sc_core{ 00037 00038 // ---------------------------------------------------------------------------- 00039 // CLASS : sc_name_gen 00040 // 00041 // Unique name generator class. 00042 // ---------------------------------------------------------------------------- 00043 00044 class sc_name_gen 00045 { 00046 public: 00047 00048 sc_name_gen(); 00049 ~sc_name_gen(); 00050 00051 const char* gen_unique_name( const char* basename_, 00052 bool preserve_first = false 00053 ); 00054 00055 private: 00056 00057 sc_strhash<int*> m_unique_name_map; 00058 char m_unique_name[BUFSIZ]; 00059 00060 private: 00061 00062 // disabled 00063 sc_name_gen( const sc_name_gen& ); 00064 sc_name_gen& operator = ( const sc_name_gen& ); 00065 }; 00066 00067 } // namespace sc_core 00068 00069 // $Log: sc_name_gen.h,v $ 00070 // Revision 1.5 2011/08/26 20:46:10 acg 00071 // Andy Goodrich: moved the modification log to the end of the file to 00072 // eliminate source line number skew when check-ins are done. 00073 // 00074 // Revision 1.4 2011/02/18 20:27:14 acg 00075 // Andy Goodrich: Updated Copyrights. 00076 // 00077 // Revision 1.3 2011/02/13 21:47:37 acg 00078 // Andy Goodrich: update copyright notice. 00079 // 00080 // Revision 1.2 2008/05/22 17:06:26 acg 00081 // Andy Goodrich: updated copyright notice to include 2008. 00082 // 00083 // Revision 1.1.1.1 2006/12/15 20:20:05 acg 00084 // SystemC 2.3 00085 // 00086 // Revision 1.3 2006/01/13 18:44:30 acg 00087 // Added $Log to record CVS changes into the source. 00088 00089 #endif 00090 00091 // Taf!