📄 devicerecord.hh
字号:
/* -*- c++ -*- --------------------------------------------------------------- Copyright (C) 2005, SWECO, All Rights Reserved. Device state information type Author: Zsolt Molnar (Zsolt.Molnar@ieee.org) ---------------------------------------------------------------------------*/#ifndef __DEVICERECORD_HH__#define __DEVICERECORD_HH__#include <iostream>#include "base.hh"#include "Lockable.hh"#include "Device.hh"#ifdef _cplusplusextern "C" {#endiftypedef enum DeviceState { UNKNOWN, UNCONNECTED, NOT_CONNECTABLE, CONNECTED, ACCEPTED, REFUSED, TIMEOUT, ERROR, RETRY};class DeviceRecord : public Lockable{ friend istream& operator >> (istream&, DeviceRecord&); friend ostream& operator << (ostream& aStream, DeviceRecord&);public: explicit DeviceRecord(const Device& aDevice, const DeviceState& aState = UNKNOWN); ~DeviceRecord() {}; bool operator == (const DeviceRecord& aOp) const; bool operator != (const DeviceRecord& aOp) const; DeviceRecord& operator = (const DeviceRecord& aOp); Device device; DeviceState state;};istream& operator >> (istream& aStream, DeviceRecord& aDevRec); ostream& operator << (ostream& aStream, DeviceRecord& aDevRec);inlineDeviceRecord::DeviceRecord(const Device& aDevice, const DeviceState& aState) : device(aDevice), state(aState){ // EMPTY}inline bool DeviceRecord::operator == (const DeviceRecord& aOp) const{ return device == aOp.device;}inline bool DeviceRecord::operator != (const DeviceRecord& aOp) const{ return !(*this == aOp);}inline DeviceRecord& DeviceRecord::operator = (const DeviceRecord& aOp){ if (&aOp != this) { device = aOp.device; state = aOp.state; } return *this;}#ifdef _cplusplus}#endif#endif /* #ifndef __DEVICERECORD_HH__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -