Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members

connector.cc

Go to the documentation of this file.
00001 /*--------------------------------------------------------------------
00002  *
00003  * (C) Copyright Koninklijke Philips Electronics NV 2006. 
00004  * All rights reserved. This software is licensed under the terms of
00005  * version 2.1 of the GNU Lesser General Public License as published 
00006  * by the Free Software Foundation. For licensing and warranty
00007  * information, see the file COPYING in the main directory.
00008  *
00009  *------------------------------------------------------------------*/
00010 
00011 #include <sys/types.h>
00012 #include "connector.h"
00013 #include <assert.h>
00014 #include <iostream>
00015 
00016 Connector::Connector(const IdBase& n) : IdBase(n)
00017 { }
00018 
00019 unsigned int Connector::nrSrc() const
00020 {
00021   return s.size();
00022 }
00023 
00024 unsigned int Connector::nrDst() const
00025 {
00026   return d.size();
00027 }
00028 
00029 Connector* Connector::getSrc(unsigned int i) const
00030 {
00031   assert(i < s.size());
00032   return s[i];
00033 }
00034 
00035 Connector* Connector::getDst(unsigned int i) const
00036 {
00037   assert(i < d.size());
00038   return d[i];
00039 }
00040 
00041 void link(Connector& s, Connector& d)
00042 {
00043   s.d.push_back(&d);
00044   d.s.push_back(&s);
00045 }
00046 

Generated on Wed Feb 15 14:52:38 2006 for yapi by doxygen 1.3.2