variable.h

00001 /***************************************************************************
00002  *   Copyright (C) 2004-2005 by Daniel Clarke   daniel.jc@gmail.com        *
00003  *   Copyright (C)      2005 by David Saxton                               *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #ifndef VARIABLE_H
00022 #define VARIABLE_H
00023 
00024 #include <qstring.h>
00025 #include <qvaluelist.h>
00026 
00027 class PortPin;
00028 typedef QValueList<PortPin> PortPinList;
00029 
00030 
00035 class Variable
00036 {
00037         public:
00038                 enum VariableType
00039                 {
00040                         charType, // 8 bit file register
00041                         sevenSegmentType, // A pin configuration for a seven segment is represented by a write-only variable.
00042                         keypadType, // A pin configuration for a keypad has 4 rows and n columns (typically n = 3 or 4) - a read-only variable
00043                         invalidType
00044                 };
00045                 
00046                 Variable( VariableType type, const QString & name );
00047                 Variable();
00048                 ~Variable();
00049 
00050                 VariableType type() const { return m_type; }
00051                 QString name() const { return m_name; }
00052                 
00057                 bool isReadable() const;
00062                 bool isWritable() const;
00066                 void setPortPinList( const PortPinList & portPinList );
00070                 PortPinList portPinList() const { return m_portPinList; }
00071                 
00072         protected:
00073                 VariableType m_type;
00074                 QString m_name;
00075                 PortPinList m_portPinList;
00076 };
00077 typedef QValueList<Variable> VariableList;
00078 
00079 #endif

Generated on Tue May 8 17:05:34 2007 for KTechLab by  doxygen 1.5.1