/src/ois/includes/OISFactoryCreator.h

https://bitbucket.org/cabalistic/ogredeps/ · C Header · 81 lines · 18 code · 8 blank · 55 comment · 0 complexity · 0c5de1e6e81a51e815d48191b32277fb MD5 · raw file

  1. /*
  2. The zlib/libpng License
  3. Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
  4. This software is provided 'as-is', without any express or implied warranty. In no event will
  5. the authors be held liable for any damages arising from the use of this software.
  6. Permission is granted to anyone to use this software for any purpose, including commercial
  7. applications, and to alter it and redistribute it freely, subject to the following
  8. restrictions:
  9. 1. The origin of this software must not be misrepresented; you must not claim that
  10. you wrote the original software. If you use this software in a product,
  11. an acknowledgment in the product documentation would be appreciated but is
  12. not required.
  13. 2. Altered source versions must be plainly marked as such, and must not be
  14. misrepresented as being the original software.
  15. 3. This notice may not be removed or altered from any source distribution.
  16. */
  17. #ifndef OIS_FactoryCreator_H
  18. #define OIS_FactoryCreator_H
  19. #include "OISPrereqs.h"
  20. namespace OIS
  21. {
  22. /**
  23. Interface for creating devices - all devices ultimately get enumerated/created via a factory.
  24. A factory can create multiple types of objects.
  25. */
  26. class _OISExport FactoryCreator
  27. {
  28. public:
  29. /**
  30. @remarks Virtual Destructor
  31. */
  32. virtual ~FactoryCreator() {};
  33. /**
  34. @remarks Return a list of all unused devices the factory maintains
  35. */
  36. virtual DeviceList freeDeviceList() = 0;
  37. /**
  38. @remarks Number of total devices of requested type
  39. @param iType Type of devices to check
  40. */
  41. virtual int totalDevices(Type iType) = 0;
  42. /**
  43. @remarks Number of free devices of requested type
  44. @param iType Type of devices to check
  45. */
  46. virtual int freeDevices(Type iType) = 0;
  47. /**
  48. @remarks Does a Type exist with the given vendor name
  49. @param iType Type to check
  50. @param vendor Vendor name to test
  51. */
  52. virtual bool vendorExist(Type iType, const std::string & vendor) = 0;
  53. /**
  54. @remarks Creates the object
  55. @param iType Type to create
  56. @param bufferMode True to setup for buffered events
  57. @param vendor Create a device with the vendor name, "" means vendor name is unimportant
  58. */
  59. virtual Object* createObject(InputManager* creator, Type iType, bool bufferMode, const std::string & vendor = "") = 0;
  60. /**
  61. @remarks Destroys object
  62. @param obj Object to destroy
  63. */
  64. virtual void destroyObject(Object* obj) = 0;
  65. };
  66. }
  67. #endif //OIS_FactoryCreator_H