defs.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #pragma once
  2. // unique tag to fix pragma once gcc glueing: ./library/cpp/messagebus/defs.h
  3. #include "codegen.h"
  4. #include "netaddr.h"
  5. #include <library/cpp/deprecated/enum_codegen/enum_codegen.h>
  6. #include <util/generic/list.h>
  7. #include <utility>
  8. // For historical reasons TCrawlerModule need to access
  9. // APIs that should be private.
  10. class TCrawlerModule;
  11. struct TDebugReceiverHandler;
  12. namespace NBus {
  13. namespace NPrivate {
  14. class TAcceptor;
  15. struct TBusSessionImpl;
  16. class TRemoteServerSession;
  17. class TRemoteClientSession;
  18. class TRemoteConnection;
  19. class TRemoteServerConnection;
  20. class TRemoteClientConnection;
  21. class TBusSyncSourceSessionImpl;
  22. struct TBusMessagePtrAndHeader;
  23. struct TSessionDumpStatus;
  24. struct TClientRequestImpl;
  25. }
  26. class TBusSession;
  27. struct TBusServerSession;
  28. struct TBusClientSession;
  29. class TBusProtocol;
  30. class TBusMessage;
  31. class TBusMessageConnection;
  32. class TBusMessageQueue;
  33. class TBusLocator;
  34. struct TBusQueueConfig;
  35. struct TBusSessionConfig;
  36. struct TBusHeader;
  37. class IThreadHandler;
  38. using TBusKey = ui64;
  39. using TBusMessageList = TList<TBusMessage*>;
  40. using TBusKeyVec = TVector<std::pair<TBusKey, TBusKey>>;
  41. using TBusMessageQueuePtr = TIntrusivePtr<TBusMessageQueue>;
  42. class TBusModule;
  43. using TBusData = TString;
  44. using TBusService = const char*;
  45. #define YBUS_KEYMIN TBusKey(0L)
  46. #define YBUS_KEYMAX TBusKey(-1L)
  47. #define YBUS_KEYLOCAL TBusKey(7L)
  48. #define YBUS_KEYINVALID TBusKey(99999999L)
  49. // Check that generated id is valid for remote message
  50. inline bool IsBusKeyValid(TBusKey key) {
  51. return key != YBUS_KEYINVALID && key != YBUS_KEYMAX && key > YBUS_KEYLOCAL;
  52. }
  53. #define YBUS_VERSION 0
  54. #define YBUS_INFINITE (1u << 30u)
  55. #define YBUS_STATUS_BASIC 0x0000
  56. #define YBUS_STATUS_CONNS 0x0001
  57. #define YBUS_STATUS_INFLIGHT 0x0002
  58. }