Include SplashImage and detect right type
This commit is contained in:
@@ -6,7 +6,7 @@ namespace FileProcessor {
|
||||
class State {
|
||||
private:
|
||||
struct Reserved {
|
||||
uint32_t reserved[2];
|
||||
uint32_t reserved[4];
|
||||
};
|
||||
|
||||
struct Configuration;
|
||||
@@ -26,6 +26,12 @@ namespace FileProcessor {
|
||||
Configuration config;
|
||||
Reserved reserved;
|
||||
|
||||
template<typename T>
|
||||
static __always_inline State from(const T& reserved, const uint32_t* data_adr, bool (*process_routine)(Configuration&, T&, size_t)) {
|
||||
return {Configuration::from(process_routine, data_adr), *reinterpret_cast<const Reserved*>(&reserved)};
|
||||
static_assert(sizeof(T) <= sizeof(Reserved));
|
||||
}
|
||||
|
||||
public:
|
||||
bool process(size_t size) {
|
||||
return (*this->config.process_routine)(this->config, this->reserved, size);
|
||||
|
Reference in New Issue
Block a user