TlFactory.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #ifndef __MV_TLFACTORY_H__
  2. #define __MV_TLFACTORY_H__
  3. #include "GenApi/Synch.h"
  4. #include "MvInclude.h"
  5. #include "MvDeviceBase.h"
  6. namespace MvCamCtrl
  7. {
  8. class MV_CAMCTRL_API CTlFactory : public IDeviceFactory
  9. {
  10. public:
  11. /// Retrieve the transport layer factory singleton
  12. static CTlFactory& GetInstance();
  13. /// Retrieve all available transport layers
  14. unsigned int EnumerateTls();
  15. /** @fn EnumDevices( unsigned int nTLayerType , MV_CC_DEVICE_INFO_LIST& stDevList )
  16. * @brief 枚举子网内,指定的传输协议对应的所有设备
  17. * @param nTLayerType [IN] - 指定的传输协议
  18. stDevList [OUT] - 设备信息列表
  19. *
  20. * @return 成功,返回MV_OK;失败,返回错误码
  21. * @fn EnumDevices( unsigned int nTLayerType , MV_CC_DEVICE_INFO_LIST& stDevList )
  22. * @brief Enumerate all devices within the subnet that correspond to the specified transport protocol
  23. * @param nTLayerType [IN] - Specified transport protocol
  24. stDevList [OUT] - Device information list
  25. *
  26. * @return Success, return MV_OK; Fail, return Error code
  27. */
  28. virtual int EnumDevices( unsigned int nTLayerType , MV_CC_DEVICE_INFO_LIST& stDevList );
  29. /** @fn CreateDevice( const MV_CC_DEVICE_INFO& device )
  30. * @brief 创建设备代理类
  31. * @param device [IN] - 设备信息(仅要求传输层类型有效即可)
  32. *
  33. * @return 成功,返回设备代理实例;失败,返回NULL
  34. * @fn CreateDevice( const MV_CC_DEVICE_INFO& device )
  35. * @brief Create Device Agent Class
  36. * @param device [IN] - Device Information(Only the transport layer type valid is required)
  37. *
  38. * @return Success, return device agent instance; Fail, return NULL
  39. */
  40. virtual IMvDevice* CreateDevice( const MV_CC_DEVICE_INFO& device );
  41. /** @fn DestroyDevice( IMvDevice* pDevice)
  42. * @brief 销毁指定设备的内部资源
  43. * @param pDevice [IN] - 设备对象
  44. *
  45. * @return 成功,返回MV_OK;失败,返回错误码
  46. * @fn DestroyDevice( IMvDevice* pDevice)
  47. * @brief Destroy the internal resources of the specified device
  48. * @param pDevice [IN] - Device Object
  49. *
  50. * @return Success, return MV_OK; Fail, return Error code
  51. */
  52. virtual int DestroyDevice( IMvDevice* );
  53. /** @fn IsDeviceAccessible( const MV_CC_DEVICE_INFO& deviceInfo)
  54. * @brief 判断指定的设备是否可以访问
  55. * @param deviceInfo [IN] - 指定的设备信息
  56. *
  57. * @return 可以访问,返回 true ;没有权限或设备已掉线,返回 false
  58. * @note 暂不支持
  59. * @fn IsDeviceAccessible( const MV_CC_DEVICE_INFO& deviceInfo)
  60. * @brief Determine whether the specified device is accessible
  61. * @param deviceInfo [IN] - Specified device information
  62. *
  63. * @return Can be accessed, return true; no permissions or the device is dropped, return false
  64. * @note Not supported yet
  65. */
  66. virtual bool IsDeviceAccessible( const MV_CC_DEVICE_INFO& deviceInfo);
  67. ~CTlFactory( void );
  68. virtual unsigned int GetSDKVersion();
  69. protected:
  70. static CTlFactory m_sTLinstance;
  71. GenApi::CLock m_cLock;
  72. CTlRefs* m_pCreatedTls;
  73. private:
  74. CTlFactory( void );
  75. CTlFactory& operator=( const CTlFactory& );
  76. CTlFactory( const CTlFactory& );
  77. };
  78. }
  79. #endif /* __MV_TLFACTORY_H__ */