ymllink.h

Go to the documentation of this file.
00001 /*******************************************************************\
00002 
00003                    SESAME project software license
00004 
00005               Copyright (C) 2002 University of Amsterdam
00006 
00007     This program is free software; you can redistribute it and/or
00008      modify it under the terms of the GNU General Public License
00009     as published by the Free Software Foundation; either version 2
00010         of the License, or (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015              GNU General Public License for more details.
00016 
00017   You should have received a copy of the GNU General Public License
00018      along with this program; if not, write to the Free Software
00019       Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00020                            02111-1307, USA.
00021 
00022       For information regarding the SESAME software project see
00023               http://sesamesim.sourceforge.net or email
00024                     jcofflan@users.sourceforge.net
00025 
00026 \*******************************************************************/
00039 #ifndef YMLLINK_H
00040 #define YMLLINK_H
00041 
00042 #include "ymlentity.h"
00043 
00044 #include <BasicUtils/BasicException.h>
00045 
00046 class YMLPortSide;
00047 class YMLNetwork;
00048 
00049 // YMLLink
00050 class YMLLink: public YMLEntity {
00052   YMLPortSide *portSides[2];
00053 
00055   YMLNetwork *network;
00056 
00057   int commChannelID;
00058 
00059  public:
00060   YMLLink();
00061 
00068   void setPortSide(int i, YMLPortSide *portSide)
00069   {ASSERT_OR_THROW("Out of range!", 0 <= i && i < 2); portSides[i] = portSide;}
00070 
00077   YMLPortSide *getPortSide(int i)
00078   {ASSERT_OR_THROW("Out of range!", 0 <= i && i < 2); return portSides[i];}
00079   const char *getNodeName(int i);
00080   const char *getPortName(int i);
00081 
00087   YMLNetwork *getNetwork() {return network;}
00088 
00094   void setNetwork(YMLNetwork *network) {this->network = network;}
00095 
00096   void setCommChannelID(const int id) {commChannelID = id;}
00097   int getCommChannelID() {return commChannelID;}
00098 
00099   virtual void dumpXML(XMLSerializer &stream);
00100   virtual void dumpDOT(std::ostream &stream, int tabLevel);
00104   virtual void doFinalize() {finalize();}
00110   virtual ymlentity_t getType() {return ymlLink;}
00111 };
00112 
00113 #endif // YMLLINK_H
00114 

Generated on Wed Apr 5 20:57:46 2006 for Sesame by  doxygen 1.4.6