From 813a725f68775bd6a618e5eb3393f655313b647c Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Fri, 9 Dec 2016 13:07:49 -0800 Subject: [PATCH] ControlReference: move function bodies out of header --- .../ControlReference/ControlReference.cpp | 25 +++++++++++++++++++ .../ControlReference/ControlReference.h | 19 ++++---------- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/Source/Core/InputCommon/ControlReference/ControlReference.cpp b/Source/Core/InputCommon/ControlReference/ControlReference.cpp index 4268531668..5b5d807781 100644 --- a/Source/Core/InputCommon/ControlReference/ControlReference.cpp +++ b/Source/Core/InputCommon/ControlReference/ControlReference.cpp @@ -36,6 +36,31 @@ void ControlReference::UpdateReference(ciface::Core::DeviceContainer& devices, parse_error = ParseExpression(expression, finder, &parsed_expression); } +ControlReference::~ControlReference() +{ + delete parsed_expression; +} +int ControlReference::BoundCount() const +{ + if (parsed_expression) + return parsed_expression->num_controls; + else + return 0; +} + +ControlReference::ControlReference(const bool _is_input) + : range(1), is_input(_is_input), parsed_expression(nullptr) +{ +} + +InputReference::InputReference() : ControlReference(true) +{ +} + +OutputReference::OutputReference() : ControlReference(false) +{ +} + // // InputReference :: State // diff --git a/Source/Core/InputCommon/ControlReference/ControlReference.h b/Source/Core/InputCommon/ControlReference/ControlReference.h index 335675e5eb..64f782b2ce 100644 --- a/Source/Core/InputCommon/ControlReference/ControlReference.h +++ b/Source/Core/InputCommon/ControlReference/ControlReference.h @@ -22,10 +22,12 @@ class ControlReference public: static bool InputGateOn(); + virtual ~ControlReference(); virtual ControlState State(const ControlState state = 0) = 0; virtual ciface::Core::Device::Control* Detect(const unsigned int ms, ciface::Core::Device* const device) = 0; + int BoundCount() const; void UpdateReference(ciface::Core::DeviceContainer& devices, const ciface::Core::DeviceQualifier& default_device); @@ -34,19 +36,8 @@ public: const bool is_input; ciface::ExpressionParser::ExpressionParseStatus parse_error; - virtual ~ControlReference() { delete parsed_expression; } - int BoundCount() - { - if (parsed_expression) - return parsed_expression->num_controls; - else - return 0; - } - protected: - ControlReference(const bool _is_input) : range(1), is_input(_is_input), parsed_expression(nullptr) - { - } + ControlReference(const bool _is_input); ciface::ExpressionParser::Expression* parsed_expression; }; @@ -58,7 +49,7 @@ protected: class InputReference : public ControlReference { public: - InputReference() : ControlReference(true) {} + InputReference(); ControlState State(const ControlState state) override; ciface::Core::Device::Control* Detect(const unsigned int ms, ciface::Core::Device* const device) override; @@ -72,7 +63,7 @@ public: class OutputReference : public ControlReference { public: - OutputReference() : ControlReference(false) {} + OutputReference(); ControlState State(const ControlState state) override; ciface::Core::Device::Control* Detect(const unsigned int ms, ciface::Core::Device* const device) override;