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_length_param.cpp - 00021 00022 Original Author: Martin Janssen, Synopsys, Inc., 2002-03-19 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 00037 // $Log: sc_length_param.cpp,v $ 00038 // Revision 1.1.1.1 2006/12/15 20:31:36 acg 00039 // SystemC 2.2 00040 // 00041 // Revision 1.3 2006/01/13 18:49:32 acg 00042 // Added $Log command so that CVS check in comments are reproduced in the 00043 // source. 00044 // 00045 00046 #include "sysc/datatypes/int/sc_length_param.h" 00047 00048 00049 namespace sc_dt 00050 { 00051 00052 // ---------------------------------------------------------------------------- 00053 // CLASS : sc_length_param 00054 // 00055 // Length parameter type. 00056 // ---------------------------------------------------------------------------- 00057 00058 const std::string 00059 sc_length_param::to_string() const 00060 { 00061 std::string s; 00062 00063 char buf[BUFSIZ]; 00064 00065 s += "("; 00066 std::sprintf( buf, "%d", m_len ); 00067 s += buf; 00068 s += ")"; 00069 00070 return s; 00071 } 00072 00073 00074 void 00075 sc_length_param::print( ::std::ostream& os ) const 00076 { 00077 os << to_string(); 00078 } 00079 00080 void 00081 sc_length_param::dump( ::std::ostream& os ) const 00082 { 00083 os << "sc_length_param" << ::std::endl; 00084 os << "(" << ::std::endl; 00085 os << "len = " << m_len << ::std::endl; 00086 os << ")" << ::std::endl; 00087 } 00088 00089 } // namespace sc_dt 00090 00091 00092 // Taf!