wac_download_http_receiver_factory.cpp 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #define GUID_EQUALS_DEFINED
  2. //#include "util.h"
  3. #include "api__wac_downloadManager.h"
  4. #include "wac_download_http_receiver.h"
  5. //#include "wac_download_http_receiver_api.h"
  6. #include "wac_download_http_receiver_factory.h"
  7. static const std::string _serviceName = "DownloadManager HTTP Receiver Service";
  8. FOURCC wa::Factory::WAC_DownloadMabager_HTTPReceiver_Factory::GetServiceType()
  9. {
  10. return WaSvc::OBJECT;
  11. }
  12. const char *wa::Factory::WAC_DownloadMabager_HTTPReceiver_Factory::GetServiceName()
  13. {
  14. return _serviceName.c_str();
  15. }
  16. GUID wa::Factory::WAC_DownloadMabager_HTTPReceiver_Factory::GetGUID()
  17. {
  18. return httpreceiverGUID2;
  19. }
  20. void *wa::Factory::WAC_DownloadMabager_HTTPReceiver_Factory::GetInterface( int global_lock )
  21. {
  22. //if ( JNL::open_socketlib() )
  23. // return NULL;
  24. api_wac_download_manager_http_receiver *ifc = new wa::Components::WAC_Download_HTTP_Receiver();
  25. //JNL::close_socketlib(); // new JNL_HTTPGet will call open_socketlib also, so we can release now
  26. //// if (global_lock)
  27. //// WASABI_API_SVC->service_lock(this, (void *)ifc);
  28. return ifc;
  29. //return NULL;
  30. }
  31. int wa::Factory::WAC_DownloadMabager_HTTPReceiver_Factory::SupportNonLockingInterface()
  32. {
  33. return 1;
  34. }
  35. int wa::Factory::WAC_DownloadMabager_HTTPReceiver_Factory::ReleaseInterface( void *ifc )
  36. {
  37. //WASABI_API_SVC->service_unlock(ifc);
  38. api_wac_download_manager_http_receiver *httpget = static_cast<api_wac_download_manager_http_receiver *>( ifc );
  39. if ( httpget )
  40. httpget->Release();
  41. return 1;
  42. }
  43. const char *wa::Factory::WAC_DownloadMabager_HTTPReceiver_Factory::GetTestString()
  44. {
  45. return NULL;
  46. }
  47. int wa::Factory::WAC_DownloadMabager_HTTPReceiver_Factory::ServiceNotify( int msg, int param1, int param2 )
  48. {
  49. return 1;
  50. }
  51. #define CBCLASS wa::Factory::WAC_DownloadMabager_HTTPReceiver_Factory
  52. START_DISPATCH;
  53. CB( WASERVICEFACTORY_GETSERVICETYPE, GetServiceType )
  54. CB( WASERVICEFACTORY_GETSERVICENAME, GetServiceName )
  55. CB( WASERVICEFACTORY_GETGUID, GetGUID )
  56. CB( WASERVICEFACTORY_GETINTERFACE, GetInterface )
  57. CB( WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface )
  58. CB( WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface )
  59. CB( WASERVICEFACTORY_GETTESTSTRING, GetTestString )
  60. CB( WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify )
  61. END_DISPATCH;
  62. #undef CBCLASS