Commit 3bf87b6a authored by legoc's avatar legoc

Changed implementation of DriverState by storing the typed owner pointer

parent 3e07144d
......@@ -63,14 +63,16 @@ template<typename DriverType>
class DriverState : public DeviceDriverState {
public:
DriverState(DriverType * owner) : DeviceDriverState(owner) {}
DriverState(DriverType * owner) : DeviceDriverState(owner) {
m_typedOwner = owner;
}
virtual DriverType * owner();
};
inline DriverType * owner() {
return m_typedOwner;
}
template<typename DriverType>
DriverType * DriverState<DriverType>::owner() {
return dynamic_cast<DriverType *>(m_owner);
}
private:
DriverType * m_typedOwner;
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment