Integrate all the progress into master #6
|
@ -77,13 +77,14 @@ namespace JabyEngine {
|
|||
template<typename T>
|
||||
struct IOPort {
|
||||
using Value = T;
|
||||
T value;
|
||||
|
||||
T read() const {
|
||||
return {const_cast<const volatile Value*>(reinterpret_cast<const Value*>(this))->raw};
|
||||
return {const_cast<const volatile IOPort<T>*>(this)->value.raw};
|
||||
}
|
||||
|
||||
void write(T value) {
|
||||
const_cast<volatile Value*>(reinterpret_cast<Value*>(this))->raw = value.raw;
|
||||
const_cast<volatile IOPort<T>*>(this)->value.raw = value.raw;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue