forked from anqin/trident
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon_internal.h
More file actions
85 lines (62 loc) · 2.56 KB
/
common_internal.h
File metadata and controls
85 lines (62 loc) · 2.56 KB
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
83
84
// Copyright (c) 2014 The Trident Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef _TRIDENT_COMMON_INTERNAL_H_
#define _TRIDENT_COMMON_INTERNAL_H_
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <trident/atomic.h>
#include <trident/common.h>
#include <trident/counter.h>
#include <trident/func_tracer.h>
#include <trident/io_service.h>
#include <trident/locks.h>
#include <trident/ptime.h>
namespace trident {
class RpcControllerImpl;
typedef trident::shared_ptr<RpcControllerImpl> RpcControllerImplPtr;
typedef trident::weak_ptr<RpcControllerImpl> RpcControllerImplWPtr;
class RpcChannelImpl;
typedef trident::shared_ptr<RpcChannelImpl> RpcChannelImplPtr;
class RpcClientImpl;
typedef trident::shared_ptr<RpcClientImpl> RpcClientImplPtr;
class RpcServerImpl;
typedef trident::shared_ptr<RpcServerImpl> RpcServerImplPtr;
typedef trident::weak_ptr<RpcServerImpl> RpcServerImplWPtr;
class RpcClientStream;
typedef trident::shared_ptr<RpcClientStream> RpcClientStreamPtr;
typedef trident::weak_ptr<RpcClientStream> RpcClientStreamWPtr;
class RpcServerStream;
typedef trident::shared_ptr<RpcServerStream> RpcServerStreamPtr;
typedef trident::weak_ptr<RpcServerStream> RpcServerStreamWPtr;
class RpcListener;
typedef trident::shared_ptr<RpcListener> RpcListenerPtr;
class TimerWorker;
typedef trident::shared_ptr<TimerWorker> TimerWorkerPtr;
class RpcTimeoutManager;
typedef trident::shared_ptr<RpcTimeoutManager> RpcTimeoutManagerPtr;
class ThreadGroup;
typedef trident::shared_ptr<ThreadGroup> ThreadGroupPtr;
class ServicePool;
typedef trident::shared_ptr<ServicePool> ServicePoolPtr;
typedef trident::weak_ptr<ServicePool> ServicePoolWPtr;
class FlowController;
typedef trident::shared_ptr<FlowController> FlowControllerPtr;
class WaitEvent;
typedef trident::shared_ptr<WaitEvent> WaitEventPtr;
class WebService;
typedef trident::shared_ptr<WebService> WebServicePtr;
#define TRIDENT_DECLARE_RESOURCE_COUNTER(name_) \
extern trident::AtomicCounter g_trident_counter_##name_
#define TRIDENT_DEFINE_RESOURCE_COUNTER(name_) \
trident::AtomicCounter g_trident_counter_##name_(0)
#define TRIDENT_INC_RESOURCE_COUNTER(name_) \
++g_trident_counter_##name_
#define TRIDENT_DEC_RESOURCE_COUNTER(name_) \
--g_trident_counter_##name_
#define TRIDENT_GET_RESOURCE_COUNTER(name_) \
static_cast<int>(g_trident_counter_##name_)
TRIDENT_DECLARE_RESOURCE_COUNTER(RpcByteStream);
TRIDENT_DECLARE_RESOURCE_COUNTER(RpcListener);
} // namespace trident
#endif // _TRIDENT_COMMON_INTERNAL_H_