HTTPReaderFactory.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #include "api__filereader.h"
  2. #include "HTTPReaderFactory.h"
  3. #include "HTTPReader.h"
  4. static const char serviceName[] = "HTTP reader";
  5. // {bc10fa00-53F5-4032-BD29-032B87EC3404}
  6. static const GUID HTTPReaderGUID =
  7. { 0xbc10fa00, 0x53f5, 0x4032, { 0xa0, 0x09, 0x2, 0x2b, 0x87, 0xec, 0x34, 0x04 } };
  8. FOURCC HTTPReaderFactory::GetServiceType()
  9. {
  10. return WaSvc::FILEREADER;
  11. }
  12. const char *HTTPReaderFactory::GetServiceName()
  13. {
  14. return serviceName;
  15. }
  16. GUID HTTPReaderFactory::GetGUID()
  17. {
  18. return HTTPReaderGUID;
  19. }
  20. void *HTTPReaderFactory::GetInterface( int global_lock )
  21. {
  22. HTTPReader *ifc = new HTTPReader;
  23. if ( global_lock )
  24. WASABI_API_SVC->service_lock( this, (void *)ifc );
  25. return ifc;
  26. }
  27. int HTTPReaderFactory::SupportNonLockingInterface()
  28. {
  29. return 1;
  30. }
  31. int HTTPReaderFactory::ReleaseInterface(void *ifc)
  32. {
  33. //WASABI_API_SVC->service_unlock(ifc);
  34. svc_fileReader *reader = static_cast<svc_fileReader *>(ifc);
  35. HTTPReader *resourceReader = static_cast<HTTPReader *>(reader);
  36. delete resourceReader;
  37. return 1;
  38. }
  39. const char *HTTPReaderFactory::GetTestString()
  40. {
  41. return 0;
  42. }
  43. int HTTPReaderFactory::ServiceNotify(int msg, int param1, int param2)
  44. {
  45. return 1;
  46. }
  47. #ifdef CBCLASS
  48. #undef CBCLASS
  49. #endif
  50. #define CBCLASS HTTPReaderFactory
  51. START_DISPATCH;
  52. CB( WASERVICEFACTORY_GETSERVICETYPE, GetServiceType )
  53. CB( WASERVICEFACTORY_GETSERVICENAME, GetServiceName )
  54. CB( WASERVICEFACTORY_GETGUID, GetGUID )
  55. CB( WASERVICEFACTORY_GETINTERFACE, GetInterface )
  56. CB( WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface )
  57. CB( WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface )
  58. CB( WASERVICEFACTORY_GETTESTSTRING, GetTestString )
  59. CB( WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify )
  60. END_DISPATCH;