pin.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __BARRY_PIN_H__
00023 #define __BARRY_PIN_H__
00024
00025 #include "dll.h"
00026 #include <stdint.h>
00027 #include <string>
00028
00029 namespace Barry {
00030
00031 class BXEXPORT Pin
00032 {
00033 uint32_t pin;
00034
00035 public:
00036 Pin(uint32_t pin__ = 0) : pin(pin__) {}
00037
00038 bool valid() const { return pin != 0; }
00039
00040 void clear() { pin = 0; }
00041 std::string str() const;
00042 uint32_t value() const { return pin; }
00043
00044 Pin& operator=(uint32_t p) { pin = p; return *this; }
00045
00046 bool operator==(uint32_t rhs) const { return pin == rhs; }
00047 bool operator==(const Pin &rhs) const { return pin == rhs.pin; }
00048
00049 bool operator!=(uint32_t rhs) const { return pin != rhs; }
00050 bool operator!=(const Pin &rhs) const { return pin != rhs.pin; }
00051 };
00052
00053
00054
00055 BXEXPORT std::istream& operator>>(std::istream &is, Pin &pin);
00056
00057 }
00058
00059 #endif
00060