aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/messagebus/config/defs.h
blob: 92b1df996989d24a4a1e87259f242e540fc9e2a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#pragma once

// unique tag to fix pragma once gcc glueing: ./library/cpp/messagebus/defs.h

#include "codegen.h"
#include "netaddr.h"

#include <library/cpp/deprecated/enum_codegen/enum_codegen.h>

#include <util/generic/list.h>

#include <utility>

// For historical reasons TCrawlerModule need to access
// APIs that should be private.
class TCrawlerModule;

struct TDebugReceiverHandler;

namespace NBus {
    namespace NPrivate {
        class TAcceptor;
        struct TBusSessionImpl;
        class TRemoteServerSession;
        class TRemoteClientSession;
        class TRemoteConnection;
        class TRemoteServerConnection;
        class TRemoteClientConnection;
        class TBusSyncSourceSessionImpl;

        struct TBusMessagePtrAndHeader;

        struct TSessionDumpStatus;

        struct TClientRequestImpl;

    }

    class TBusSession;
    struct TBusServerSession;
    struct TBusClientSession;
    class TBusProtocol;
    class TBusMessage;
    class TBusMessageConnection;
    class TBusMessageQueue;
    class TBusLocator;
    struct TBusQueueConfig;
    struct TBusSessionConfig;
    struct TBusHeader;

    class IThreadHandler;

    using TBusKey = ui64;
    using TBusMessageList = TList<TBusMessage*>;
    using TBusKeyVec = TVector<std::pair<TBusKey, TBusKey>>;

    using TBusMessageQueuePtr = TIntrusivePtr<TBusMessageQueue>;

    class TBusModule;

    using TBusData = TString;
    using TBusService = const char*;

#define YBUS_KEYMIN TBusKey(0L)
#define YBUS_KEYMAX TBusKey(-1L)
#define YBUS_KEYLOCAL TBusKey(7L)
#define YBUS_KEYINVALID TBusKey(99999999L)

    // Check that generated id is valid for remote message
    inline bool IsBusKeyValid(TBusKey key) {
        return key != YBUS_KEYINVALID && key != YBUS_KEYMAX && key > YBUS_KEYLOCAL;
    }

#define YBUS_VERSION 0

#define YBUS_INFINITE (1u << 30u)

#define YBUS_STATUS_BASIC 0x0000
#define YBUS_STATUS_CONNS 0x0001
#define YBUS_STATUS_INFLIGHT 0x0002

}