common.h 1.7 KB
Newer Older
W
wangguibao 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once
#include <error.h>
#include <getopt.h>
W
sdk-cpp  
wangguibao 已提交
18
#include <pthread.h>
W
wangguibao 已提交
19 20
#include <stdint.h>
#include <stdlib.h>
W
sdk-cpp  
wangguibao 已提交
21
#include <strings.h>
W
wangguibao 已提交
22 23
#include <sys/types.h>
#include <unistd.h>
W
sdk-cpp  
wangguibao 已提交
24 25
#include <exception>

W
wangguibao 已提交
26 27
#include "gflags/gflags.h"
#include "google/protobuf/message.h"
W
sdk-cpp  
wangguibao 已提交
28

W
wangguibao 已提交
29 30 31 32 33
#ifdef BCLOUD
#include "baidu/rpc/channel.h"
#include "baidu/rpc/parallel_channel.h"
#include "baidu/rpc/traceprintf.h"
#include "base/comlog_sink.h"
34
#include "base/logging.h"
W
wangguibao 已提交
35 36
#include "base/object_pool.h"
#include "base/time.h"
W
wangguibao 已提交
37
#include "bthread.h"  // NOLINT
W
wangguibao 已提交
38
#else
W
wangguibao 已提交
39 40 41 42 43 44 45
#include "brpc/channel.h"
#include "brpc/parallel_channel.h"
#include "brpc/traceprintf.h"
#include "bthread/bthread.h"
#include "butil/logging.h"
#include "butil/object_pool.h"
#include "butil/time.h"
W
wangguibao 已提交
46 47
#endif

W
wangguibao 已提交
48
#include "bvar/bvar.h"
W
wangguibao 已提交
49 50

#ifdef BCLOUD
W
wangguibao 已提交
51
#include "json_to_pb.h"  // NOLINT
W
wangguibao 已提交
52
#else
W
wangguibao 已提交
53
#include "json2pb/json_to_pb.h"
W
wangguibao 已提交
54
#endif
W
sdk-cpp  
wangguibao 已提交
55

B
barrierye 已提交
56
#include "core/configure/general_model_config.pb.h"
G
guru4elephant 已提交
57 58
#include "core/configure/include/configure_parser.h"
#include "core/configure/sdk_configure.pb.h"
W
sdk-cpp  
wangguibao 已提交
59

G
guru4elephant 已提交
60
#include "core/sdk-cpp/include/utils.h"
W
wangguibao 已提交
61 62 63 64 65

#ifdef BCLOUD
namespace brpc = baidu::rpc;
namespace butil = base;
#endif