ivservice.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include "ivservice.h"
  2. #include "ivservice_impl.h"
  3. namespace iv {
  4. namespace service {
  5. Server::Server(const char *strservicename, ServiceProc xProc)
  6. {
  7. Server_impl * pserver = new Server_impl(strservicename,xProc);
  8. mpimpl = (void *)pserver;
  9. }
  10. Server::~Server()
  11. {
  12. Server_impl * pserver = (Server_impl *)mpimpl;
  13. delete pserver;
  14. }
  15. Client::Client(const char *strservicename)
  16. {
  17. Client_impl * pclient = new Client_impl(strservicename);
  18. mpimpl = pclient;
  19. }
  20. Client::~Client()
  21. {
  22. Client_impl * pclient = (Client_impl * )mpimpl;
  23. delete pclient;
  24. }
  25. Client::ServiceResRes Client::SendRequest(std::shared_ptr<char> pstr_request,const int nreqsize, std::shared_ptr<char> &pstr_response, int & nressize,const int timeout)
  26. {
  27. Client_impl * pclient = (Client_impl * )mpimpl;
  28. return pclient->SendRequest(pstr_request,nreqsize,pstr_response,nressize,timeout);
  29. }
  30. int Client::AsyncSendRequest(std::shared_ptr<char> pstr_request, const int nreqsize, ServiceAsycnProc xProc, const int timeout)
  31. {
  32. Client_impl * pclient = (Client_impl *)mpimpl;
  33. return pclient->AsyncSendRequest(pstr_request,nreqsize,xProc,timeout);
  34. }
  35. }
  36. }