Skip to content

Commit

Permalink
framework: split cc_library for transport (ApolloAuto#1188)
Browse files Browse the repository at this point in the history
* framework: split cc_library for transport

* framework: split cc_library for node
  • Loading branch information
baowanyu authored and Jiangtao Hu committed Dec 13, 2018
1 parent 6e39889 commit df8c9ec
Show file tree
Hide file tree
Showing 23 changed files with 480 additions and 727 deletions.
72 changes: 37 additions & 35 deletions cyber/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,65 +6,65 @@ cc_library(
name = "cyber",
linkstatic = False,
deps = [
"//cyber:cyber_core",
"//cyber:cyber_core",
],
)

cc_binary(
name = "mainboard",
srcs = glob([
"mainboard/*.cc",
"mainboard/*.h",
"mainboard/*.cc",
"mainboard/*.h",
]),
copts = [
"-pthread",
"-pthread",
],
linkstatic = False,
deps = [
":cyber_core",
"//cyber/proto:dag_config_cc_proto",
":cyber_core",
"//cyber/proto:dag_config_cc_proto",
],
)

cc_binary(
name = "libcyber.so",
#TODO: Using deps instead.
linkopts = [
"-luuid",
"-luuid",
],
linkshared = True,
linkstatic = True,
deps = [
":cyber_core",
"@fastrtps//:fastrtps",
":cyber_core",
"@fastrtps//:fastrtps",
],
)

cc_library(
name = "binary",
hdrs = [
"binary.h",
"binary.h",
],
)

cc_library(
name = "state",
srcs = [
"state.cc",
"state.cc",
],
hdrs = [
"state.h",
"state.h",
],
)

cc_library(
name = "init",
hdrs = [
"cyber.h",
"init.h",
"cyber.h",
"init.h",
],
deps = [
"state",
"state",
],
)

Expand All @@ -82,42 +82,44 @@ cc_library(
],
deps = [
"//cyber:binary",
"//cyber:init",
"//cyber:state",
"//cyber/base",
"//cyber/blocker:blocker_manager",
"//cyber/class_loader",
"//cyber/class_loader:class_loader_manager",
"//cyber/common",
"//cyber/component",
"//cyber/component:component",
"//cyber/component:timer_component",
"//cyber/croutine",
"//cyber/data",
"//cyber/class_loader:class_loader",
"//cyber/class_loader:class_loader_manager",
"//cyber/croutine:croutine",
"//cyber/data:data",
"//cyber/event:perf_event",
"//cyber/event:perf_event_cache",
"//cyber/logger",
"//cyber:init",
"//cyber/logger:logger",
"//cyber/logger:async_logger",
"//cyber/message:intra_message_traits",
"//cyber/message:message_traits",
"//cyber/message:protobuf_traits",
"//cyber/message:py_message_traits",
"//cyber/message:raw_message_traits",
"//cyber/node",
"//cyber/message:py_message_traits",
"//cyber/message:protobuf_traits",
"//cyber/message:intra_message_traits",
"//cyber/node:node",
"//cyber/proto:run_mode_conf_cc_proto",
"//cyber/parameter:parameter_client",
"//cyber/parameter:parameter_server",
"//cyber/proto:run_mode_conf_cc_proto",
"//cyber/record",
"//cyber/scheduler",
"//cyber/service",
"//cyber/record:record",
"//cyber/scheduler:scheduler",
"//cyber/service:client",
"//cyber/service:service",
"//cyber/service_discovery:topology_manager",
"//cyber/task",
"//cyber/time",
"//cyber/task:task",
"//cyber/time:time",
"//cyber/time:duration",
"//cyber/time:rate",
"//cyber/timer",
"//cyber/transport:transport_lib",
"//third_party/tf2",
"//cyber/timer:timer",
"//cyber/transport:transport",
"//cyber/transport:participant",
"//cyber/transport:sub_listener",
"//third_party/tf2:tf2",
"@fastrtps",
],
)
Expand Down
5 changes: 5 additions & 0 deletions cyber/component/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ cc_library(
"component_base",
"//cyber/blocker:blocker_manager",
"//cyber/timer:timer",
"//cyber/transport:history",
"//cyber/transport:hybrid_transmitter",
"//cyber/transport:intra_transmitter",
"//cyber/transport:rtps_transmitter",
"//cyber/transport:shm_transmitter",
],
)

Expand Down
93 changes: 71 additions & 22 deletions cyber/node/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,42 @@ load("//tools:cpplint.bzl", "cpplint")
package(default_visibility = ["//visibility:public"])

cc_library(
name = "reader_base",
hdrs = glob([
"reader_base.h",
]),
name = "node",
srcs = [ "node.cc", ],
hdrs = [ "node.h", ],
deps = [
"//cyber/transport:transport_lib",
"//cyber/common:common",
"//cyber/event:perf_event_cache",
"node_channel_impl",
"node_service_impl",
],
)

cc_library(
name = "node",
srcs = glob([
"node.cc",
]),
hdrs = glob([
"*.h",
]),
name = "node_channel_impl",
hdrs = [ "node_channel_impl.h", ],
deps = [
"//cyber/transport:transport_lib",
"reader",
"writer",
"//cyber/blocker:intra_reader",
"//cyber/blocker:intra_writer",
"//cyber/croutine:croutine",
"//cyber/data:data_visitor",
"//cyber/scheduler:scheduler",
"//cyber/common:global_data",
"//cyber/message:message_traits",
"//cyber/proto:run_mode_conf_cc_proto",
],
)

cc_library(
name = "node_service_impl",
hdrs = [ "node_service_impl.h", ],
deps = [
"reader",
"writer",
"//cyber/common:global_data",
"//cyber/service:client",
"//cyber/service:service",
"//cyber/service_discovery:topology_manager",
"//cyber/proto:topology_change_cc_proto",
],
)


cc_test(
name = "node_test",
Expand All @@ -49,12 +53,57 @@ cc_test(
],
)

cc_library(
name = "reader",
hdrs = [ "reader.h", ],
deps = [
"reader_base",
"//cyber/common:global_data",
"//cyber/croutine:routine_factory",
"//cyber/data:data_visitor",
"//cyber/proto:topology_change_cc_proto",
"//cyber/scheduler:scheduler",
"//cyber/service_discovery:topology_manager",
"//cyber/time:time",
"//cyber/transport:transport",
]
)

cc_library(
name = "reader_base",
hdrs = [ "reader_base.h", ],
deps = [
"//cyber/transport:transport",
"//cyber/event:perf_event_cache",
],
)

cc_library(
name = "writer",
hdrs = [ "writer.h", ],
deps = [
"writer_base",
"//cyber/common:log",
"//cyber/proto:topology_change_cc_proto",
"//cyber/service_discovery:topology_manager",
"//cyber/transport:transport",
],
)

cc_library(
name = "writer_base",
hdrs = [ "writer_base.h", ],
deps = [
"//cyber/common:macros",
"//cyber/common:util",
"//cyber/proto:role_attributes_cc_proto",
],
)

cc_test(
name = "writer_reader_test",
size = "small",
srcs = [
"writer_reader_test.cc",
],
srcs = [ "writer_reader_test.cc", ],
deps = [
"//cyber",
"//cyber/proto:unit_test_cc_proto",
Expand Down
12 changes: 10 additions & 2 deletions cyber/service_discovery/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ cc_library(
"node_manager",
"service_manager",
"//cyber:init",
"//cyber/transport:participant",
],
)

Expand All @@ -30,7 +31,8 @@ cc_library(
srcs = [ "communication/participant_listener.cc", ],
hdrs = [ "communication/participant_listener.h", ],
deps = [
"//cyber/transport/rtps:rtps_lib",
"//cyber/common:log",
"@fastrtps//:fastrtps",
],
)

Expand All @@ -39,7 +41,10 @@ cc_library(
srcs = [ "communication/subscriber_listener.cc", ],
hdrs = [ "communication/subscriber_listener.h", ],
deps = [
"//cyber/transport/rtps:rtps_lib",
"//cyber/common:log",
"//cyber/transport:underlay_message",
"//cyber/transport:underlay_message_type",
"@fastrtps//:fastrtps",
],
)

Expand Down Expand Up @@ -121,6 +126,9 @@ cc_library(
"//cyber/proto:role_attributes_cc_proto",
"//cyber/proto:topology_change_cc_proto",
"//cyber/time:time",
"//cyber/transport:attributes_filler",
"//cyber/transport:underlay_message_type",
"//cyber/transport:qos_profile_conf",
],
)

Expand Down
Loading

0 comments on commit df8c9ec

Please sign in to comment.