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 std::string str() const;
00041 uint32_t value() const { return pin; }
00042
00043 Pin& operator=(uint32_t p) { pin = p; return *this; }
00044
00045 bool operator==(uint32_t rhs) const { return pin == rhs; }
00046 bool operator==(const Pin &rhs) const { return pin == rhs.pin; }
00047
00048 bool operator!=(uint32_t rhs) const { return pin != rhs; }
00049 bool operator!=(const Pin &rhs) const { return pin != rhs.pin; }
00050 };
00051
00052
00053
00054 BXEXPORT std::istream& operator>>(std::istream &is, Pin &pin);
00055
00056 }
00057
00058 #endif
00059