#pragma region CPL License /* Nuclex Native Framework Copyright (C) 2002-2013 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #pragma endregion // CPL License #ifndef NUCLEX_INPUT_DEVICES_INPUTDEVICE_H #define NUCLEX_INPUT_DEVICES_INPUTDEVICE_H #include // --------------------------------------------------------------------------------------------- // namespace Nuclex { namespace Input { class InputManager; }} // namespace Nuclex::Input namespace Nuclex { namespace Input { namespace Devices { // ------------------------------------------------------------------------------------------- // /// Device through which the user can send input to a game /// Type of states returned by this input device template class InputDevice { friend InputManager; // only the service may trigger snapshots on devices /// Initializes a new input device protected: InputDevice() {} /// Destroys the input device public: virtual ~InputDevice() {} /// Whether the input device is currently attached /// True if the input device is attached, otherwise false public: virtual bool IsAttached() const = 0; /// Retrieves the human-readable name of the input device /// The human-readable name of the input device public: virtual const std::string &GetName() const = 0; /// Retrieves the current state of the input device /// The input device's current state public: virtual const TState &GetState() const = 0; /// Updates the state of the input device protected: virtual void Update() = 0; /// Takes a snapshot of the input device's current state protected: virtual void TakeSnapshot() = 0; /// Removes all snapshots the device has taken protected: virtual void ClearSnapshots() = 0; private: InputDevice(const InputDevice &); private: InputDevice &operator =(const InputDevice &); }; // ------------------------------------------------------------------------------------------- // }}} // namespace Nuclex::Input::Devices #endif // NUCLEX_INPUT_DEVICES_INPUTDEVICE_H