bbob_channel.h

Go to the documentation of this file.
00001 #ifndef BBOB_CHANNEL_H
00002 #define BBOB_CHANNEL_H
00003 
00004 #include <QWidget>
00005 #include <QString>
00006 #include "bbob_settings.h"
00007 
00008 #include "bbob_module_base.h"
00009 
00010 #define Channel_Type_Bit        0x01
00011 #define Channel_Type_Byte       0x02
00012 #define Channel_Type_String     0x04
00013 
00014 #define Channel_Mimetype_Bit    "application/x-bbob-bit"
00015 #define Channel_Mimetype_Byte   "application/x-bbob-byte"
00016 #define Channel_Mimetype_String "application/x-bbob-string"
00017 
00018 #define Channel_Dir_In          0x01
00019 #define Channel_Dir_Out         0x02
00020 
00021 
00022 /// Basic I/O Signals and Slots
00023 class BBoB_Channel : public QObject
00024 {
00025     QMap<QString, QString> Connections;
00026 
00027     QMap<int, QString> InputData;
00028 
00029 public:
00030     BBoB_Channel();
00031     BBoB_Channel(  BBoB_Module_Base* mod, int channel_dir = Channel_Dir_In, int channel_type = Channel_Type_Bit, QString channel_name = "");
00032 
00033     /// Less than operator for sorting in QMap.
00034     bool operator<(const BBoB_Channel& other) const;
00035 
00036     /// Holds the source of this channel, required to save/load connection state.
00037     BBoB_Module_Base* ModuleBase;
00038 
00039     QString     name;
00040     int         type;
00041     int         dir;
00042 
00043     /// Return the name of the module this channel is in.
00044     QString     getModName();
00045 
00046     /// Return the name of this channel.
00047     QString     getName();
00048 
00049     /// Set the name of this channel.
00050     void        setName( QString n );
00051 
00052     /// Return the type (bit|byte|string) of this channel.
00053     int         getType();
00054 
00055     /// Return a string of Mimetype based on type.
00056     QString     getMimetype();
00057 
00058     /// Returns a pointer to the channel cast as an int.
00059     int         getPointer();
00060 
00061     /// Default function that can be overidden later.
00062     void SaveSettings(const BBoB_Settings* settings, const QString modName);
00063 
00064     /// Keeps a list of data with priority levels, for cue stacking
00065     void Input(const int level, const QString s);
00066 
00067     virtual void SendOutput(const QString s) = 0;
00068     virtual void Output(const QString s) = 0;
00069     virtual void Input(const QString s) = 0;
00070 };
00071 
00072 #endif
00073 

Generated on Sun Oct 28 22:51:26 2007 for BBoB by  doxygen 1.5.3