pinapa-port-plus.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * arch-tag: Matthieu MOY, Fri Jul 02 16:00:21 2004 (scp-port-plus.h)
00003  *------------------------------------------------------------------------------
00004  *         Copyright (c) STMicroelectronics,Verimag
00005  * Pinapa is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Lesser 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  * This library 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  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library; if not, write to the Free
00017  * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00018  * MA 02111-1307, USA
00019  *------------------------------------------------------------------------------
00020  *                 System Platform Group - HPC
00021  *******************************************************************************/
00022 
00030 #include "pinapa-parser-all.h"
00031 
00032 #ifndef PINAPA_PORT_PLUS_H
00033 #define PINAPA_PORT_PLUS_H
00034 
00035 #include "pinapa-systemc-light.h"
00036 #include <ext/hash_set>
00037 #include "tlm_port.h"
00038 
00039 // namespace pinapa useless.
00040 
00046 namespace std {
00047   template <>
00048   struct equal_to<sc_port_base *> : public binary_function<sc_port_base *,
00049                                                            sc_port_base *,
00050                                                            bool> {
00051     bool operator()(sc_port_base * s1, sc_port_base * s2) const {
00052       return s1 == s2;
00053     }
00054   };
00055 }
00056 
00057 namespace HASH_NAMESPACE {
00058   template <>
00059   struct hash<sc_port_base *> {
00060     size_t operator()(const sc_port_base * s) const {
00061 #ifdef PINAPA_DETERMINISTIC_LUSTRE
00062       return 0;
00063 #else
00064       hash<int> H;
00065       return H((int)s);
00066 #endif
00067     }
00068   };
00069 }
00070 
00071 namespace std {
00072   template <>
00073   struct equal_to<tlm_port *> : public binary_function<tlm_port *,
00074                                                        tlm_port *,
00075                                                        bool> {
00076     bool operator()(tlm_port * s1, tlm_port * s2) const {
00077       return s1 == s2;
00078     }
00079   };
00080 }
00081 
00082 namespace HASH_NAMESPACE {
00083   template <>
00084   struct hash<tlm_port *> {
00085     size_t operator()(const tlm_port * s) const {
00086 #ifdef PINAPA_DETERMINISTIC_LUSTRE
00087       return 0;
00088 #else
00089       hash<int> H;
00090       return H((int)s);
00091 #endif
00092     }
00093   };
00094 }
00095 
00101 #endif // PINAPA_PORT_PLUS_H
00102 
Generated by
Matthieu Moy <Matthieu.Moy@st.com>
Back to Pinapa Home Page