1 2 // This file is part of the Alliance Project. 3 // Copyright (C) Laboratoire LIP6 - Departement ASIM 4 // Universite Pierre et Marie Curie 5 // 6 // The Alliance Project is free software; you can redistribute it and/or 7 // modify it under the terms of the GNU General Public License as 8 // published by the Free Software Foundation; either version 2 of the 9 // License, or (at your option) any later version. 10 // 11 // The Alliance Project is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 // General Public License for more details. 15 // 16 // You should have received a copy of the GNU General Public License 17 // along with the Alliance Project; if not, write to the Free Software 18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 // 20 // 21 // License-Tag 22 // 23 // Date : 29/01/2004 24 // Author : Christophe Alexandre <Christophe.Alexandre@lip6.fr> 25 // 26 // Authors-Tag 27 #ifndef __PNET_H 28 #define __PNET_H 29 30 #include <iostream> 31 #include <fstream> 32 #include <vector> 33 #include "mut.h" 34 #include "mlo.h" 35 using namespace std; 36 37 class PElem; 38 39 class PNet { 40 41 public: 42 43 typedef vector <PElem*> PElems; 44 45 protected: 46 47 const losig* _sig; 48 PElems _elems; 49 50 public: 51 52 PNet(const losig* sig); 53 GetSig()54 const losig* GetSig() const { return _sig; } GetElems()55 PElems& GetElems() { return _elems; } GetConstElems()56 const PElems& GetConstElems() const { return _elems; } 57 58 ostream& Print(ostream& os) const; 59 void DescribeOn(ostream& os) const; 60 61 ofstream& Plot(ofstream& out) const; 62 }; 63 64 static inline ostream& operator<<(ostream& os, const PNet& net) { 65 return net.Print(os); 66 } 67 68 static inline ostream& operator<<(ostream& os, const PNet* net) { 69 return net ? net->Print(os) : os << "(nil)"; 70 } 71 72 #endif /* __PNET_H */ 73