Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members

MControlOutputPort.h

00001 /*
00002 
00003     This file is part of la Marmite.
00004     Copyright (C) 2005 Nicolas Falquet.
00005 
00006     La Marmite is free software ; you can redistribute it and/or
00007     modify it under the terms of the GNU General Public License as
00008     published by the Free Software Foundation ; either version 2 of
00009     the License, or (at your option) any later version.
00010 
00011     La Marmite is distributed in the hope that it will be useful, but
00012     WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with la Marmite ; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019     02111-1307  USA
00020 
00021 */
00022 
00023 #ifndef M_CONTROL_OUTPUT_PORT_H
00024 #define M_CONTROL_OUTPUT_PORT_H
00025 
00026 using namespace std;
00027 
00028 #include "MPort.h"
00029 
00030 #include <vector>
00031 
00032 class MControlInputPort;
00033 
00038 class MControlOutputPort /* abstract */ : public MPort
00039 {
00040 
00041   Q_OBJECT
00042 
00043 public :
00044 
00045   // destructor
00046 
00047   virtual ~ MControlOutputPort ( ) { }
00048 
00049   // functions
00050 
00056   virtual bool IsAudio ( ) const
00057     {
00058       return false;
00059     }
00060 
00066   virtual bool IsControl ( ) const
00067     {
00068       return true;
00069     }
00070 
00076   virtual bool IsInput ( ) const
00077     {
00078       return false;
00079     }
00080 
00086   virtual bool IsOutput ( ) const
00087     {
00088       return true;
00089     }
00090 
00091   virtual bool IsConnectedTo ( const MPort * port ) const;
00092 
00093   virtual unsigned int NumberOfConnections ( ) const;
00094 
00095   virtual MPort * Connection ( const unsigned int n ) const;
00096   // on devrait pouvoir mettre MControlInputPort * en retour
00097   // mais ca conflicte sans trop que je pige ( cf. doc )
00098 
00099 public slots :
00100 
00110   virtual bool Connect ( MControlInputPort * port ) = 0;
00111 
00121   virtual bool Disconnect ( MControlInputPort * port ) = 0;
00122 
00123 protected :
00124 
00125   // protected constructor
00126 
00131   MControlOutputPort ( string name, MModule * module )
00132     : MPort ( name, module ) { }
00133 
00134   // attributes
00135 
00137   vector < MControlInputPort * > _connection;
00138 
00139 };
00140 
00141 #endif // M_CONTROL_OUTPUT_PORT_H

Generated on Mon Jan 31 12:43:30 2005 for la Marmite by Doxygen 1.4.1