12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #include "Common.h"
- #include "USBIO.h"
- #include "SerializedObject.h"
- namespace Voxel
- {
-
- class VOXEL_EXPORT HardwareSerializer
- {
- uint8_t _ioRequestCode, _sizeRequestCode;
- USBIOPtr _usbIO;
- public:
- HardwareSerializer() {}
-
-
- HardwareSerializer(USBIOPtr &usbIO, uint8_t ioRequestCode, uint8_t sizeRequestCode):
- _usbIO(usbIO), _ioRequestCode(ioRequestCode), _sizeRequestCode(sizeRequestCode) {}
-
-
- bool read(Version &version, TimeStampType &knownTimestamp, SerializedObject &so);
-
-
- bool write(Version &version, TimeStampType ×tamp, SerializedObject &so);
-
-
- bool writeToFile(const String &filename, Version &version, TimeStampType ×tamp, SerializedObject &so);
-
- inline void setUSBIO(USBIOPtr &usbIO) { _usbIO = usbIO; }
-
- inline operator bool () { return _usbIO.get() != nullptr; }
-
-
- bool getSize(uint32_t &size);
-
- virtual ~HardwareSerializer() {}
- };
- typedef Ptr<HardwareSerializer> HardwareSerializerPtr;
-
- }
|