www.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include <library/cpp/messagebus/ybus.h>
  3. #include <library/cpp/messagebus/oldmodule/module.h>
  4. #include <util/generic/ptr.h>
  5. #include <util/generic/string.h>
  6. #include <library/cpp/cgiparam/cgiparam.h>
  7. namespace NBus {
  8. class TBusWww: public TAtomicRefCount<TBusWww> {
  9. public:
  10. struct TLink {
  11. TString Title;
  12. TString Href;
  13. };
  14. struct TOptionalParams {
  15. TVector<TLink> ParentLinks;
  16. };
  17. TBusWww();
  18. ~TBusWww();
  19. void RegisterClientSession(TBusClientSessionPtr);
  20. void RegisterServerSession(TBusServerSessionPtr);
  21. void RegisterQueue(TBusMessageQueuePtr);
  22. void RegisterModule(TBusModule*);
  23. void ServeHttp(IOutputStream& httpOutputStream, const TCgiParameters& queryArgs, const TOptionalParams& params = TOptionalParams());
  24. struct TImpl;
  25. THolder<TImpl> Impl;
  26. };
  27. class TBusWwwHttpServer {
  28. public:
  29. TBusWwwHttpServer(TIntrusivePtr<TBusWww> www, unsigned port);
  30. ~TBusWwwHttpServer();
  31. struct TImpl;
  32. THolder<TImpl> Impl;
  33. };
  34. }