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

vpControl.h

Go to the documentation of this file.
00001 
00010 #if !defined(AFX_VPCONTROL_H__FC551DAD_F111_4F6C_97CA_4D532CD51012__INCLUDED_)
00011 #define AFX_VPCONTROL_H__FC551DAD_F111_4F6C_97CA_4D532CD51012__INCLUDED_
00012 
00013 #if _MSC_VER > 1000
00014 #pragma once
00015 #pragma warning ( disable : 4786 )
00016 #endif // _MSC_VER > 1000
00017 
00019 
00022 class vpControl  
00023 {
00024 public:
00026 
00034     inline vpControl(unsigned char source_type,
00035                      unsigned char source_numID,
00036                      unsigned char source_channel);
00037 
00039 
00044     inline void set(unsigned char source_type,
00045                 unsigned char source_numID,
00046                 unsigned char source_channel);
00047 
00049 
00052     inline unsigned char Type();
00053 
00055 
00058     inline unsigned char NumID();
00059 
00061 
00064     inline unsigned char Channel(); 
00065 
00067     vpControl();
00068 
00070     virtual ~vpControl();
00071 
00073 friend bool operator < (const vpControl &x,const vpControl &y);
00074 
00075 private:
00077 
00082     unsigned long unity; 
00083 };
00084 
00086 inline bool operator < (const vpControl &x,const vpControl &y) {
00087     return (x.unity < y.unity);
00088 }
00089 
00090 inline vpControl::vpControl(unsigned char source_type,
00091                      unsigned char source_numID,
00092                      unsigned char source_channel) {
00093     unity=(((long) source_type) << 16) |
00094           (((long) source_numID) << 8) |
00095           (((long) source_channel));
00096 
00097 };
00098 
00099 
00100 inline void vpControl::set(unsigned char source_type,
00101                      unsigned char source_numID,
00102                      unsigned char source_channel) {
00103     unity=(((long) source_type) << 16) |
00104           (((long) source_numID) << 8) |
00105           (((long) source_channel));
00106 
00107 };
00108 
00109 inline unsigned char vpControl::Type() {
00110     return (unsigned char) ((unity & 0x00FF0000) >> 16);
00111 };
00112 
00113 inline unsigned char vpControl::NumID() {
00114     return (unsigned char) ((unity & 0x00FF00) >> 8);
00115 };
00116 
00117 inline unsigned char vpControl::Channel() {
00118     return (unsigned char) (unity & 0x00FF);
00119 };
00120 
00121 
00122 #include <map>
00123 #include "ActionTriple.h"
00124 
00125 using namespace std;
00126 
00133 typedef map<vpControl,ActionTriple,less< vpControl > > vpHash;
00134 
00139 typedef vpHash::const_iterator vpHashPtr;
00140 
00141 #endif // !defined(AFX_VPCONTROL_H__FC551DAD_F111_4F6C_97CA_4D532CD51012__INCLUDED_)

Generated on Tue Oct 16 14:06:18 2001 for PuppetMaster by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001