/src/ois/src/extras/LIRC/OISLIRCFactoryCreator.h
C++ Header | 98 lines | 40 code | 19 blank | 39 comment | 0 complexity | 6a66d4a732ed0790346f891285655fdd MD5 | raw file
1#include "OISConfig.h" 2#ifdef OIS_LIRC_SUPPORT 3/* 4The zlib/libpng License 5 6Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com) 7 8This software is provided 'as-is', without any express or implied warranty. In no event will 9the authors be held liable for any damages arising from the use of this software. 10 11Permission is granted to anyone to use this software for any purpose, including commercial 12applications, and to alter it and redistribute it freely, subject to the following 13restrictions: 14 15 1. The origin of this software must not be misrepresented; you must not claim that 16 you wrote the original software. If you use this software in a product, 17 an acknowledgment in the product documentation would be appreciated but is 18 not required. 19 20 2. Altered source versions must be plainly marked as such, and must not be 21 misrepresented as being the original software. 22 23 3. This notice may not be removed or altered from any source distribution. 24*/ 25#ifndef OIS_LIRCFactoryCreator_H 26#define OIS_LIRCFactoryCreator_H 27 28#include "OISPrereqs.h" 29#include "OISFactoryCreator.h" 30#include "OISLIRC.h" 31 32namespace OIS 33{ 34 //Forward declare local classes 35 class LIRCControl; 36 37 /** LIRC Factory Creator Class */ 38 class _OISExport LIRCFactoryCreator : public FactoryCreator 39 { 40 public: 41 LIRCFactoryCreator(); 42 ~LIRCFactoryCreator(); 43 44 //FactoryCreator Overrides 45 /** @copydoc FactoryCreator::deviceList */ 46 DeviceList freeDeviceList(); 47 48 /** @copydoc FactoryCreator::totalDevices */ 49 int totalDevices(Type iType); 50 51 /** @copydoc FactoryCreator::freeDevices */ 52 int freeDevices(Type iType); 53 54 /** @copydoc FactoryCreator::vendorExist */ 55 bool vendorExist(Type iType, const std::string & vendor); 56 57 /** @copydoc FactoryCreator::createObject */ 58 Object* createObject(InputManager* creator, Type iType, bool bufferMode, const std::string & vendor = ""); 59 60 /** @copydoc FactoryCreator::destroyObject */ 61 void destroyObject(Object* obj); 62 63 protected: 64 //! Gets a list of all remotes available 65 void discoverRemotes(); 66 67 //! Connects to LIRC server 68 void enableConnection(bool enable, bool blocking = true); 69 70 //! Creates/destroys threaded read 71 void enableConnectionThread(bool enable); 72 73 void threadUpdate(); 74 75 std::string mIP; 76 std::string mPort; 77 bool mConnected; 78 volatile bool mThreadRunning; 79 std::map<std::string, LIRCControl*> mUpdateRemotes; 80 81 //! List of vendor named remotes that are not used yet 82 std::vector<std::string> mUnusedRemotes; 83 84 //! Information about enumerated remotes 85 std::map<std::string, RemoteInfo> mJoyStickInformation; 86 87 //! Number of total found remotes 88 int mCount; 89 90 //! Get the slow boost header includes from this header by using a proxy wrapper 91 class BoostWrapper; 92 93 //! Wrapped objects 94 BoostWrapper *mWrapped; 95 }; 96} 97#endif //OIS_LIRCFactoryCreator_H 98#endif