00001 /*************************************************************************** 00002 * Copyright (C) 2003 by Gav Wood * 00003 * gav@cs.york.ac.uk * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU Library General Public License as * 00007 * published by the Free Software Foundation; either version 2 of the * 00008 * License, or (at your option) any later version. * 00009 ***************************************************************************/ 00010 00011 #ifndef _RGEDDEI_ABSTRACTPROCESSORPORT_H 00012 #define _RGEDDEI_ABSTRACTPROCESSORPORT_H 00013 00014 namespace rGeddei 00015 { 00016 00017 class AbstractProcessor; 00018 00033 class AbstractProcessorPort 00034 { 00035 friend class AbstractProcessor; 00036 friend class AbstractProcessorIn; 00037 00038 AbstractProcessor *theParent; 00039 uint thePort, theBufferSize; 00040 00041 AbstractProcessorPort(AbstractProcessor *parent, const uint port) : theParent(parent), thePort(port), theBufferSize(1) {} 00042 00043 public: 00061 AbstractProcessorPort &setSize(const uint bufferSize) { theBufferSize = bufferSize; return *this; } 00062 00079 const bool split(); 00080 00097 const bool share(); 00098 00116 const bool connect(const AbstractProcessorPort &input); 00117 00132 const bool disconnect(); 00133 00151 const bool operator>>=(const AbstractProcessorPort &input) { return connect(input); } 00152 00167 const bool operator--(int) { return disconnect(); } 00168 }; 00169 00170 } 00171 00172 #endif