factory_xml.cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #include "api__xml.h"
  2. #include "factory_xml.h"
  3. #include "XMLReader.h"
  4. static const char serviceName[] = "XML Parser";
  5. FOURCC XMLFactory::GetServiceType()
  6. {
  7. return WaSvc::OBJECT;
  8. }
  9. const char *XMLFactory::GetServiceName()
  10. {
  11. return serviceName;
  12. }
  13. GUID XMLFactory::GetGUID()
  14. {
  15. return obj_xmlGUID;
  16. }
  17. void *XMLFactory::GetInterface(int global_lock)
  18. {
  19. obj_xml *ifc=new XMLReader;
  20. // if (global_lock)
  21. // WASABI_API_SVC->service_lock(this, (void *)ifc);
  22. return ifc;
  23. }
  24. int XMLFactory::SupportNonLockingInterface()
  25. {
  26. return 1;
  27. }
  28. int XMLFactory::ReleaseInterface(void *ifc)
  29. {
  30. //WASABI_API_SVC->service_unlock(ifc);
  31. obj_xml *xml = static_cast<obj_xml *>(ifc);
  32. XMLReader *xmlreader = static_cast<XMLReader *>(xml);
  33. delete xmlreader;
  34. return 1;
  35. }
  36. const char *XMLFactory::GetTestString()
  37. {
  38. return 0;
  39. }
  40. int XMLFactory::ServiceNotify(int msg, int param1, int param2)
  41. {
  42. return 1;
  43. }
  44. #ifdef CBCLASS
  45. #undef CBCLASS
  46. #endif
  47. #define CBCLASS XMLFactory
  48. START_DISPATCH;
  49. CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType)
  50. CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName)
  51. CB(WASERVICEFACTORY_GETGUID, GetGUID)
  52. CB(WASERVICEFACTORY_GETINTERFACE, GetInterface)
  53. CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface)
  54. CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface)
  55. CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString)
  56. CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify)
  57. END_DISPATCH;