From 8f082a34eccd7a742c4b8721b4d8a6ac401baa5e Mon Sep 17 00:00:00 2001 From: rex-schilasky <49162693+rex-schilasky@users.noreply.github.com> Date: Mon, 19 Feb 2024 14:21:29 +0100 Subject: [PATCH] removed all ecal internal proto files duplicates --- CMakeLists.txt | 4 + ecal/core_pb/CMakeLists.txt | 78 +++++++++++++++ ecal/core_pb/src/core_pb.cpp | 1 + .../src/ecal/core/pb}/ecal.proto | 8 +- .../src/ecal/core/pb}/host.proto | 0 .../src/ecal/core/pb}/layer.proto | 0 .../src/ecal/core/pb}/logging.proto | 0 .../src/ecal/core/pb}/monitoring.proto | 8 +- .../src/ecal/core/pb}/process.proto | 0 .../src/ecal/core/pb}/service.proto | 0 .../core_pb/src/ecal/core/pb}/topic.proto | 2 +- ecal/protobuf/monitoring.proto | 36 ------- ecal/protobuf/topic.proto | 61 ------------ .../monitoring_performance/CMakeLists.txt | 10 +- .../src/monitoring_performance.cpp | 2 +- .../src/protobuf/host.proto | 33 ------- .../src/protobuf/layer.proto | 64 ------------- .../src/protobuf/monitoring.proto | 36 ------- .../src/protobuf/process.proto | 74 --------------- .../src/protobuf/service.proto | 94 ------------------- .../src/protobuf/topic.proto | 61 ------------ .../monitoring/monitoring_rec/CMakeLists.txt | 10 +- .../monitoring_rec/src/monitoring_rec.cpp | 2 +- .../monitoring_rec/src/protobuf/host.proto | 33 ------- .../monitoring_rec/src/protobuf/layer.proto | 64 ------------- .../monitoring_rec/src/protobuf/process.proto | 74 --------------- .../monitoring_rec/src/protobuf/service.proto | 94 ------------------- .../monitoring/monitoring_reg/CMakeLists.txt | 10 +- .../monitoring_reg/src/monitoring_reg.cpp | 2 +- .../monitoring_reg/src/protobuf/ecal.proto | 71 -------------- .../monitoring_reg/src/protobuf/host.proto | 33 ------- .../monitoring_reg/src/protobuf/layer.proto | 64 ------------- .../monitoring_reg/src/protobuf/process.proto | 74 --------------- .../monitoring_reg/src/protobuf/service.proto | 94 ------------------- .../monitoring_reg/src/protobuf/topic.proto | 61 ------------ 35 files changed, 98 insertions(+), 1160 deletions(-) create mode 100644 ecal/core_pb/CMakeLists.txt create mode 100644 ecal/core_pb/src/core_pb.cpp rename ecal/{protobuf => core_pb/src/ecal/core/pb}/ecal.proto (95%) rename ecal/{protobuf => core_pb/src/ecal/core/pb}/host.proto (100%) rename ecal/{protobuf => core_pb/src/ecal/core/pb}/layer.proto (100%) rename ecal/{protobuf => core_pb/src/ecal/core/pb}/logging.proto (100%) rename {samples/cpp/monitoring/monitoring_rec/src/protobuf => ecal/core_pb/src/ecal/core/pb}/monitoring.proto (89%) rename ecal/{protobuf => core_pb/src/ecal/core/pb}/process.proto (100%) rename ecal/{protobuf => core_pb/src/ecal/core/pb}/service.proto (100%) rename {samples/cpp/monitoring/monitoring_rec/src/protobuf => ecal/core_pb/src/ecal/core/pb}/topic.proto (98%) delete mode 100644 ecal/protobuf/monitoring.proto delete mode 100644 ecal/protobuf/topic.proto delete mode 100644 samples/cpp/monitoring/monitoring_performance/src/protobuf/host.proto delete mode 100644 samples/cpp/monitoring/monitoring_performance/src/protobuf/layer.proto delete mode 100644 samples/cpp/monitoring/monitoring_performance/src/protobuf/monitoring.proto delete mode 100644 samples/cpp/monitoring/monitoring_performance/src/protobuf/process.proto delete mode 100644 samples/cpp/monitoring/monitoring_performance/src/protobuf/service.proto delete mode 100644 samples/cpp/monitoring/monitoring_performance/src/protobuf/topic.proto delete mode 100644 samples/cpp/monitoring/monitoring_rec/src/protobuf/host.proto delete mode 100644 samples/cpp/monitoring/monitoring_rec/src/protobuf/layer.proto delete mode 100644 samples/cpp/monitoring/monitoring_rec/src/protobuf/process.proto delete mode 100644 samples/cpp/monitoring/monitoring_rec/src/protobuf/service.proto delete mode 100644 samples/cpp/monitoring/monitoring_reg/src/protobuf/ecal.proto delete mode 100644 samples/cpp/monitoring/monitoring_reg/src/protobuf/host.proto delete mode 100644 samples/cpp/monitoring/monitoring_reg/src/protobuf/layer.proto delete mode 100644 samples/cpp/monitoring/monitoring_reg/src/protobuf/process.proto delete mode 100644 samples/cpp/monitoring/monitoring_reg/src/protobuf/service.proto delete mode 100644 samples/cpp/monitoring/monitoring_reg/src/protobuf/topic.proto diff --git a/CMakeLists.txt b/CMakeLists.txt index ea9ccf8..416fb9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -269,6 +269,10 @@ endif() # -------------------------------------------------------- add_subdirectory(ecal/core) +if(ECAL_CORE_BUILD_SAMPLES_PROTOBUF) + add_subdirectory(ecal/core_pb) +endif() + # -------------------------------------------------------- # core config # -------------------------------------------------------- diff --git a/ecal/core_pb/CMakeLists.txt b/ecal/core_pb/CMakeLists.txt new file mode 100644 index 0000000..7f07e98 --- /dev/null +++ b/ecal/core_pb/CMakeLists.txt @@ -0,0 +1,78 @@ +# ========================= eCAL LICENSE ================================= +# +# Copyright (C) 2016 - 2019 Continental Corporation +# +# 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. +# +# ========================= eCAL LICENSE ================================= + +project(core_pb) + +find_package(Protobuf REQUIRED) + +set(ProtoFiles + ${CMAKE_CURRENT_SOURCE_DIR}/src/ecal/core/pb/ecal.proto + ${CMAKE_CURRENT_SOURCE_DIR}/src/ecal/core/pb/host.proto + ${CMAKE_CURRENT_SOURCE_DIR}/src/ecal/core/pb/layer.proto + ${CMAKE_CURRENT_SOURCE_DIR}/src/ecal/core/pb/logging.proto + ${CMAKE_CURRENT_SOURCE_DIR}/src/ecal/core/pb/monitoring.proto + ${CMAKE_CURRENT_SOURCE_DIR}/src/ecal/core/pb/process.proto + ${CMAKE_CURRENT_SOURCE_DIR}/src/ecal/core/pb/service.proto + ${CMAKE_CURRENT_SOURCE_DIR}/src/ecal/core/pb/topic.proto +) + +# Compile statically on Windows and shared for all other systems. +# +# We compile shared on Linux etc., as we must only load the proto descriptors +# once; otherwise, protobuf would throw an exception on runtime. A shared object +# achieves that, as it is only loaded into memory once, even when being linked +# against from different libraries. +# We don't have to do that on Windows, as we compile against protobuf statically +# and therefore each .dll has it's own descriptor pool. Having a static lib here +# also has the advantage that we need to export the symbols, which is default +# disabled on Windows. +# +# TODO: Having code like that probably isn't the best solution ever. We should +# maybe always link against protobuf statically. Currently the reason why we +# don't do that is, that the default Ubuntu libprotobuf.a doesn't contain +# position independent code and can therefore not be statically compiled into a +# shared object library. +if (WIN32) + ecal_add_static_library(${PROJECT_NAME} src/core_pb.cpp) +else() + ecal_add_shared_library(${PROJECT_NAME} src/core_pb.cpp) +endif() + +add_library(eCAL::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) + +protobuf_target_cpp(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/src INSTALL_FOLDER include ${ProtoFiles}) + +target_compile_options(${PROJECT_NAME} + PRIVATE + $<$:/wd4505 /wd4592 /wd4189> + $<$:-Wno-unused-parameter>) + +set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON) + +target_link_libraries(${PROJECT_NAME} protobuf::libprotobuf) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14) + +ecal_install_library(${PROJECT_NAME}) + +if(BUILD_PY_BINDING) + protobuf_generate_python_ext(python_sources ${PYTHON_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ${ProtoFiles}) + target_sources(${PROJECT_NAME} PRIVATE ${python_sources}) + set_source_files_properties(${python_sources} PROPERTIES HEADER_FILE_ONLY TRUE) +endif() + +set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER core) diff --git a/ecal/core_pb/src/core_pb.cpp b/ecal/core_pb/src/core_pb.cpp new file mode 100644 index 0000000..0989ba9 --- /dev/null +++ b/ecal/core_pb/src/core_pb.cpp @@ -0,0 +1 @@ +// dummy file to force VS to create a library \ No newline at end of file diff --git a/ecal/protobuf/ecal.proto b/ecal/core_pb/src/ecal/core/pb/ecal.proto similarity index 95% rename from ecal/protobuf/ecal.proto rename to ecal/core_pb/src/ecal/core/pb/ecal.proto index 8786162..250496e 100644 --- a/ecal/protobuf/ecal.proto +++ b/ecal/core_pb/src/ecal/core/pb/ecal.proto @@ -19,10 +19,10 @@ syntax = "proto3"; -import "host.proto"; -import "process.proto"; -import "service.proto"; -import "topic.proto"; +import "ecal/core/pb/host.proto"; +import "ecal/core/pb/process.proto"; +import "ecal/core/pb/service.proto"; +import "ecal/core/pb/topic.proto"; package eCAL.pb; diff --git a/ecal/protobuf/host.proto b/ecal/core_pb/src/ecal/core/pb/host.proto similarity index 100% rename from ecal/protobuf/host.proto rename to ecal/core_pb/src/ecal/core/pb/host.proto diff --git a/ecal/protobuf/layer.proto b/ecal/core_pb/src/ecal/core/pb/layer.proto similarity index 100% rename from ecal/protobuf/layer.proto rename to ecal/core_pb/src/ecal/core/pb/layer.proto diff --git a/ecal/protobuf/logging.proto b/ecal/core_pb/src/ecal/core/pb/logging.proto similarity index 100% rename from ecal/protobuf/logging.proto rename to ecal/core_pb/src/ecal/core/pb/logging.proto diff --git a/samples/cpp/monitoring/monitoring_rec/src/protobuf/monitoring.proto b/ecal/core_pb/src/ecal/core/pb/monitoring.proto similarity index 89% rename from samples/cpp/monitoring/monitoring_rec/src/protobuf/monitoring.proto rename to ecal/core_pb/src/ecal/core/pb/monitoring.proto index 790e74f..7c864de 100644 --- a/samples/cpp/monitoring/monitoring_rec/src/protobuf/monitoring.proto +++ b/ecal/core_pb/src/ecal/core/pb/monitoring.proto @@ -19,10 +19,10 @@ syntax = "proto3"; -import "host.proto"; -import "process.proto"; -import "service.proto"; -import "topic.proto"; +import "ecal/core/pb/host.proto"; +import "ecal/core/pb/process.proto"; +import "ecal/core/pb/service.proto"; +import "ecal/core/pb/topic.proto"; package eCAL.pb; diff --git a/ecal/protobuf/process.proto b/ecal/core_pb/src/ecal/core/pb/process.proto similarity index 100% rename from ecal/protobuf/process.proto rename to ecal/core_pb/src/ecal/core/pb/process.proto diff --git a/ecal/protobuf/service.proto b/ecal/core_pb/src/ecal/core/pb/service.proto similarity index 100% rename from ecal/protobuf/service.proto rename to ecal/core_pb/src/ecal/core/pb/service.proto diff --git a/samples/cpp/monitoring/monitoring_rec/src/protobuf/topic.proto b/ecal/core_pb/src/ecal/core/pb/topic.proto similarity index 98% rename from samples/cpp/monitoring/monitoring_rec/src/protobuf/topic.proto rename to ecal/core_pb/src/ecal/core/pb/topic.proto index 5228d7f..90bb5e8 100644 --- a/samples/cpp/monitoring/monitoring_rec/src/protobuf/topic.proto +++ b/ecal/core_pb/src/ecal/core/pb/topic.proto @@ -19,7 +19,7 @@ syntax = "proto3"; -import "layer.proto"; +import "ecal/core/pb/layer.proto"; package eCAL.pb; diff --git a/ecal/protobuf/monitoring.proto b/ecal/protobuf/monitoring.proto deleted file mode 100644 index 790e74f..0000000 --- a/ecal/protobuf/monitoring.proto +++ /dev/null @@ -1,36 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * 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. - * - * ========================= eCAL LICENSE ================================= -*/ - -syntax = "proto3"; - -import "host.proto"; -import "process.proto"; -import "service.proto"; -import "topic.proto"; - -package eCAL.pb; - -message Monitoring // eCAL monitoring information -{ - repeated Host hosts = 1; // hosts - repeated Process processes = 2; // processes - repeated Service services = 3; // services - repeated Client clients = 5; // clients - repeated Topic topics = 4; // topics -} diff --git a/ecal/protobuf/topic.proto b/ecal/protobuf/topic.proto deleted file mode 100644 index 5228d7f..0000000 --- a/ecal/protobuf/topic.proto +++ /dev/null @@ -1,61 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * 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. - * - * ========================= eCAL LICENSE ================================= -*/ - -syntax = "proto3"; - -import "layer.proto"; - -package eCAL.pb; - -message DataTypeInformation -{ - string name = 1; // name of the datatype - string encoding = 2; // encoding of the datatype (e.g. protobuf, flatbuffers, capnproto) - bytes desc = 3; // descriptor information of the datatype (necessary for reflection) -} - -message Topic // eCAL topic -{ - int32 rclock = 1; // registration clock (heart beat) - string hname = 2; // host name - string hgname = 28; // host group name - int32 pid = 3; // process id - string pname = 4; // process name - string uname = 5; // unit name - string tid = 6; // topic id - string tname = 7; // topic name - string direction = 8; // direction (publisher, subscriber) - string ttype = 9; // topic type + topic encoding (deprecated) - bytes tdesc = 10; // topic description (protocol descriptor) (deprecated) - - DataTypeInformation tdatatype = 30; // topic datatype information (encoding & type & description) - - repeated TLayer tlayer = 12; // active topic transport layers and it's specific parameter - int32 tsize = 13; // topic size - - int32 connections_loc = 16; // number of local connected entities - int32 connections_ext = 17; // number of external connected entities - int32 message_drops = 18; // dropped messages - - int64 did = 19; // data send id (publisher setid) - int64 dclock = 20; // data clock (send / receive action) - int32 dfreq = 21; // data frequency (send / receive samples per second) [mHz] - - map attr = 27; // generic topic description -} diff --git a/samples/cpp/monitoring/monitoring_performance/CMakeLists.txt b/samples/cpp/monitoring/monitoring_performance/CMakeLists.txt index ee59a27..66684dc 100644 --- a/samples/cpp/monitoring/monitoring_performance/CMakeLists.txt +++ b/samples/cpp/monitoring/monitoring_performance/CMakeLists.txt @@ -29,19 +29,11 @@ set(monitoring_performance_src src/monitoring_performance.cpp ) -set(monitoring_rec_proto - ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/host.proto - ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/layer.proto - ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/monitoring.proto - ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/process.proto - ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/service.proto - ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/topic.proto -) ecal_add_sample(${PROJECT_NAME} ${monitoring_performance_src}) -PROTOBUF_TARGET_CPP(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf ${monitoring_rec_proto}) target_link_libraries(${PROJECT_NAME} eCAL::core + eCAL::core_pb protobuf::libprotobuf ) diff --git a/samples/cpp/monitoring/monitoring_performance/src/monitoring_performance.cpp b/samples/cpp/monitoring/monitoring_performance/src/monitoring_performance.cpp index ec3fae5..c4547fe 100644 --- a/samples/cpp/monitoring/monitoring_performance/src/monitoring_performance.cpp +++ b/samples/cpp/monitoring/monitoring_performance/src/monitoring_performance.cpp @@ -26,7 +26,7 @@ #ifdef _MSC_VER #pragma warning(push, 0) #endif -#include +#include #ifdef _MSC_VER #pragma warning(pop) #endif diff --git a/samples/cpp/monitoring/monitoring_performance/src/protobuf/host.proto b/samples/cpp/monitoring/monitoring_performance/src/protobuf/host.proto deleted file mode 100644 index f16fdfe..0000000 --- a/samples/cpp/monitoring/monitoring_performance/src/protobuf/host.proto +++ /dev/null @@ -1,33 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * 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. - * - * ========================= eCAL LICENSE ================================= -*/ - -syntax = "proto3"; - -package eCAL.pb; - -message OSInfo // operating system details -{ - string osname = 1; // name -} - -message Host // eCAL host -{ - string hname = 1; // host name - OSInfo os = 2; // operating system details -} diff --git a/samples/cpp/monitoring/monitoring_performance/src/protobuf/layer.proto b/samples/cpp/monitoring/monitoring_performance/src/protobuf/layer.proto deleted file mode 100644 index d6de62d..0000000 --- a/samples/cpp/monitoring/monitoring_performance/src/protobuf/layer.proto +++ /dev/null @@ -1,64 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * 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. - * - * ========================= eCAL LICENSE ================================= -*/ - -syntax = "proto3"; - -package eCAL.pb; - -message LayerParUdpMC -{ -} - -message LayerParShm -{ - repeated string memory_file_list = 1; // list of memory file names -} - -message LayerParInproc -{ -} - -message LayerParTcp -{ - int32 port = 1; // tcp writers port number -} - -message ConnnectionPar // connection parameter for reader / writer -{ - LayerParUdpMC layer_par_udpmc = 1; // parameter for ecal udp multicast - LayerParShm layer_par_shm = 2; // parameter for ecal shared memory - LayerParTcp layer_par_tcp = 4; // parameter for ecal tcp -} - -enum eTLayerType // transport layer -{ - tl_none = 0; // undefined - tl_ecal_udp_mc = 1; // ecal udp multicast - tl_ecal_shm = 4; // ecal shared memory - tl_ecal_tcp = 5; // ecal tcp - tl_all = 255; // all layer -} - -message TLayer -{ - eTLayerType type = 1; // transport layer type - int32 version = 2; // transport layer version - bool confirmed = 3; // transport layer used ? - ConnnectionPar par_layer = 5; // transport layer parameter -} diff --git a/samples/cpp/monitoring/monitoring_performance/src/protobuf/monitoring.proto b/samples/cpp/monitoring/monitoring_performance/src/protobuf/monitoring.proto deleted file mode 100644 index 790e74f..0000000 --- a/samples/cpp/monitoring/monitoring_performance/src/protobuf/monitoring.proto +++ /dev/null @@ -1,36 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * 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. - * - * ========================= eCAL LICENSE ================================= -*/ - -syntax = "proto3"; - -import "host.proto"; -import "process.proto"; -import "service.proto"; -import "topic.proto"; - -package eCAL.pb; - -message Monitoring // eCAL monitoring information -{ - repeated Host hosts = 1; // hosts - repeated Process processes = 2; // processes - repeated Service services = 3; // services - repeated Client clients = 5; // clients - repeated Topic topics = 4; // topics -} diff --git a/samples/cpp/monitoring/monitoring_performance/src/protobuf/process.proto b/samples/cpp/monitoring/monitoring_performance/src/protobuf/process.proto deleted file mode 100644 index 2c104e8..0000000 --- a/samples/cpp/monitoring/monitoring_performance/src/protobuf/process.proto +++ /dev/null @@ -1,74 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * 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. - * - * ========================= eCAL LICENSE ================================= -*/ - -syntax = "proto3"; - -package eCAL.pb; - -enum eProcessSeverity // process severity -{ - proc_sev_unknown = 0; // condition unknown - proc_sev_healthy = 1; // process healthy - proc_sev_warning = 2; // process warning level - proc_sev_critical = 3; // process critical - proc_sev_failed = 4; // process failed -} - -enum eProcessSeverityLevel // process severity level -{ - proc_sev_level_unknown = 0; // condition unknown - proc_sev_level1 = 1; // default severity level 1 - proc_sev_level2 = 2; // severity level 2 - proc_sev_level3 = 3; // severity level 3 - proc_sev_level4 = 4; // severity level 4 - proc_sev_level5 = 5; // severity level 5 -} - -message ProcessState // process state -{ - eProcessSeverity severity = 1; // severity - eProcessSeverityLevel severity_level = 3; // severity level - string info = 2; // info string -} - -enum eTSyncState // time synchronisation -{ - tsync_none = 0; // not synchronized - tsync_realtime = 1; // real time sync mode - tsync_replay = 2; // replay time sync mode -} - -message Process // process -{ - int32 rclock = 1; // registration clock - string hname = 2; // host name - string hgname = 18; // host group name - int32 pid = 3; // process id - string pname = 4; // process name - string uname = 5; // unit name - string pparam = 6; // process parameter - int64 datawrite = 10; // data write bytes per sec - int64 dataread = 11; // data read bytes per sec - ProcessState state = 12; // process state info - eTSyncState tsync_state = 13; // time synchronization state - string tsync_mod_name = 14; // time synchronization module name - int32 component_init_state = 15; // eCAL component initialization state (eCAL::Initialize(..)) - string component_init_info = 16; // like comp_init_state as human readable string (pub|sub|srv|mon|log|time|proc) - string ecal_runtime_version = 17; // loaded / runtime eCAL version of a component -} diff --git a/samples/cpp/monitoring/monitoring_performance/src/protobuf/service.proto b/samples/cpp/monitoring/monitoring_performance/src/protobuf/service.proto deleted file mode 100644 index 6c4b591..0000000 --- a/samples/cpp/monitoring/monitoring_performance/src/protobuf/service.proto +++ /dev/null @@ -1,94 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * 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. - * - * ========================= eCAL LICENSE ================================= -*/ - -syntax = "proto3"; - -package eCAL.pb; - -message ServiceHeader -{ - enum eCallState - { - none = 0; - executed = 1; - failed = 2; - } - - string hname = 1; // host name - string sname = 2; // service name - string sid = 7; // service id - string mname = 3; // method name - string error = 4; // error message - int32 id = 5; // session id - eCallState state = 6; // method call state -} - -message Request // client request -{ - ServiceHeader header = 1; // common service header - bytes request = 2; // request payload -} - -message Response // server response -{ - ServiceHeader header = 1; // common service header - bytes response = 2; // response payload - int64 ret_state = 3; // callback return state -} - -message Method // method -{ - string mname = 1; // method name - string req_type = 2; // request type - bytes req_desc = 5; // request descriptor - string resp_type = 3; // response type - bytes resp_desc = 6; // response descriptor - int64 call_count = 4; // call counter -} - -message Service // service -{ - int32 rclock = 1; // registration clock - string hname = 2; // host name - string pname = 3; // process name - string uname = 4; // unit name - int32 pid = 5; // process id - string sname = 6; // service name - string sid = 9; // service id - repeated Method methods = 8; // list of methods - - // transport specific parameter (for internal use) - uint32 version = 10; // service protocol version - uint32 tcp_port_v0 = 7; // the tcp port used for that service - uint32 tcp_port_v1 = 11; // the tcp port used for that service -} - -message Client // client -{ - int32 rclock = 1; // registration clock - string hname = 2; // host name - string pname = 3; // process name - string uname = 4; // unit name - int32 pid = 5; // process id - string sname = 6; // service name - string sid = 7; // service id - - // transport specific parameter (for internal use) - uint32 version = 8; // client protocol version -} diff --git a/samples/cpp/monitoring/monitoring_performance/src/protobuf/topic.proto b/samples/cpp/monitoring/monitoring_performance/src/protobuf/topic.proto deleted file mode 100644 index 5228d7f..0000000 --- a/samples/cpp/monitoring/monitoring_performance/src/protobuf/topic.proto +++ /dev/null @@ -1,61 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * 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. - * - * ========================= eCAL LICENSE ================================= -*/ - -syntax = "proto3"; - -import "layer.proto"; - -package eCAL.pb; - -message DataTypeInformation -{ - string name = 1; // name of the datatype - string encoding = 2; // encoding of the datatype (e.g. protobuf, flatbuffers, capnproto) - bytes desc = 3; // descriptor information of the datatype (necessary for reflection) -} - -message Topic // eCAL topic -{ - int32 rclock = 1; // registration clock (heart beat) - string hname = 2; // host name - string hgname = 28; // host group name - int32 pid = 3; // process id - string pname = 4; // process name - string uname = 5; // unit name - string tid = 6; // topic id - string tname = 7; // topic name - string direction = 8; // direction (publisher, subscriber) - string ttype = 9; // topic type + topic encoding (deprecated) - bytes tdesc = 10; // topic description (protocol descriptor) (deprecated) - - DataTypeInformation tdatatype = 30; // topic datatype information (encoding & type & description) - - repeated TLayer tlayer = 12; // active topic transport layers and it's specific parameter - int32 tsize = 13; // topic size - - int32 connections_loc = 16; // number of local connected entities - int32 connections_ext = 17; // number of external connected entities - int32 message_drops = 18; // dropped messages - - int64 did = 19; // data send id (publisher setid) - int64 dclock = 20; // data clock (send / receive action) - int32 dfreq = 21; // data frequency (send / receive samples per second) [mHz] - - map attr = 27; // generic topic description -} diff --git a/samples/cpp/monitoring/monitoring_rec/CMakeLists.txt b/samples/cpp/monitoring/monitoring_rec/CMakeLists.txt index 7fb68c6..f886805 100644 --- a/samples/cpp/monitoring/monitoring_rec/CMakeLists.txt +++ b/samples/cpp/monitoring/monitoring_rec/CMakeLists.txt @@ -29,19 +29,11 @@ set(monitoring_rec_src src/monitoring_rec.cpp ) -set(monitoring_rec_proto - ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/host.proto - ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/layer.proto - ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/monitoring.proto - ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/process.proto - ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/service.proto - ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/topic.proto -) ecal_add_sample(${PROJECT_NAME} ${monitoring_rec_src}) -PROTOBUF_TARGET_CPP(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf ${monitoring_rec_proto}) target_link_libraries(${PROJECT_NAME} eCAL::core + eCAL::core_pb protobuf::libprotobuf ) diff --git a/samples/cpp/monitoring/monitoring_rec/src/monitoring_rec.cpp b/samples/cpp/monitoring/monitoring_rec/src/monitoring_rec.cpp index 2fe558a..ea43cd5 100644 --- a/samples/cpp/monitoring/monitoring_rec/src/monitoring_rec.cpp +++ b/samples/cpp/monitoring/monitoring_rec/src/monitoring_rec.cpp @@ -24,7 +24,7 @@ #ifdef _MSC_VER #pragma warning(push, 0) #endif -#include +#include #ifdef _MSC_VER #pragma warning(pop) #endif diff --git a/samples/cpp/monitoring/monitoring_rec/src/protobuf/host.proto b/samples/cpp/monitoring/monitoring_rec/src/protobuf/host.proto deleted file mode 100644 index f16fdfe..0000000 --- a/samples/cpp/monitoring/monitoring_rec/src/protobuf/host.proto +++ /dev/null @@ -1,33 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * 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. - * - * ========================= eCAL LICENSE ================================= -*/ - -syntax = "proto3"; - -package eCAL.pb; - -message OSInfo // operating system details -{ - string osname = 1; // name -} - -message Host // eCAL host -{ - string hname = 1; // host name - OSInfo os = 2; // operating system details -} diff --git a/samples/cpp/monitoring/monitoring_rec/src/protobuf/layer.proto b/samples/cpp/monitoring/monitoring_rec/src/protobuf/layer.proto deleted file mode 100644 index b6af045..0000000 --- a/samples/cpp/monitoring/monitoring_rec/src/protobuf/layer.proto +++ /dev/null @@ -1,64 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * 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. - * - * ========================= eCAL LICENSE ================================= -*/ - -syntax = "proto3"; - -package eCAL.pb; - -message LayerParUdpMC -{ -} - -message LayerParShm -{ - repeated string memory_file_list = 1; // list of memory file names -} - -message LayerParTcp -{ - int32 port = 1; // tcp writers port number -} - -message ConnnectionPar // connection parameter for reader / writer -{ - LayerParUdpMC layer_par_udpmc = 1; // parameter for ecal udp multicast - LayerParShm layer_par_shm = 2; // parameter for ecal shared memory - // 3 = parameter for ecal inner process - LayerParTcp layer_par_tcp = 4; // parameter for ecal tcp -} - -enum eTLayerType // transport layer -{ - tl_none = 0; // undefined - tl_ecal_udp_mc = 1; // ecal udp multicast - // 2 = ecal udp unicast (not supported anymore) - // 3 = ecal udp metal (not supported anymore) - tl_ecal_shm = 4; // ecal shared memory - tl_ecal_tcp = 5; // ecal tcp - // 42 = inproc (not supported anymore) - tl_all = 255; // all layer -} - -message TLayer -{ - eTLayerType type = 1; // transport layer type - int32 version = 2; // transport layer version - bool confirmed = 3; // transport layer used ? - ConnnectionPar par_layer = 5; // transport layer parameter -} diff --git a/samples/cpp/monitoring/monitoring_rec/src/protobuf/process.proto b/samples/cpp/monitoring/monitoring_rec/src/protobuf/process.proto deleted file mode 100644 index 903a6c2..0000000 --- a/samples/cpp/monitoring/monitoring_rec/src/protobuf/process.proto +++ /dev/null @@ -1,74 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * 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. - * - * ========================= eCAL LICENSE ================================= -*/ - -syntax = "proto3"; - -package eCAL.pb; - -enum eProcessSeverity // process severity -{ - proc_sev_unknown = 0; // condition unknown - proc_sev_healthy = 1; // process healthy - proc_sev_warning = 2; // process warning level - proc_sev_critical = 3; // process critical - proc_sev_failed = 4; // process failed -} - -enum eProcessSeverityLevel // process severity level -{ - proc_sev_level_unknown = 0; // condition unknown - proc_sev_level1 = 1; // default severity level 1 - proc_sev_level2 = 2; // severity level 2 - proc_sev_level3 = 3; // severity level 3 - proc_sev_level4 = 4; // severity level 4 - proc_sev_level5 = 5; // severity level 5 -} - -message ProcessState // process state -{ - eProcessSeverity severity = 1; // severity - eProcessSeverityLevel severity_level = 3; // severity level - string info = 2; // info string -} - -enum eTSyncState // time synchronisation -{ - tsync_none = 0; // not synchronized - tsync_realtime = 1; // real time sync mode - tsync_replay = 2; // replay time sync mode -} - -message Process // process -{ - int32 rclock = 1; // registration clock - string hname = 2; // host name - string hgname = 18; // host group name - int32 pid = 3; // process id - string pname = 4; // process name - string uname = 5; // unit name - string pparam = 6; // process parameter - // 10 = data write bytes per sec - // 11 = data read bytes per sec - ProcessState state = 12; // process state info - eTSyncState tsync_state = 13; // time synchronization state - string tsync_mod_name = 14; // time synchronization module name - int32 component_init_state = 15; // eCAL component initialization state (eCAL::Initialize(..)) - string component_init_info = 16; // like comp_init_state as human readable string (pub|sub|srv|mon|log|time|proc) - string ecal_runtime_version = 17; // loaded / runtime eCAL version of a component -} diff --git a/samples/cpp/monitoring/monitoring_rec/src/protobuf/service.proto b/samples/cpp/monitoring/monitoring_rec/src/protobuf/service.proto deleted file mode 100644 index 6c4b591..0000000 --- a/samples/cpp/monitoring/monitoring_rec/src/protobuf/service.proto +++ /dev/null @@ -1,94 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * 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. - * - * ========================= eCAL LICENSE ================================= -*/ - -syntax = "proto3"; - -package eCAL.pb; - -message ServiceHeader -{ - enum eCallState - { - none = 0; - executed = 1; - failed = 2; - } - - string hname = 1; // host name - string sname = 2; // service name - string sid = 7; // service id - string mname = 3; // method name - string error = 4; // error message - int32 id = 5; // session id - eCallState state = 6; // method call state -} - -message Request // client request -{ - ServiceHeader header = 1; // common service header - bytes request = 2; // request payload -} - -message Response // server response -{ - ServiceHeader header = 1; // common service header - bytes response = 2; // response payload - int64 ret_state = 3; // callback return state -} - -message Method // method -{ - string mname = 1; // method name - string req_type = 2; // request type - bytes req_desc = 5; // request descriptor - string resp_type = 3; // response type - bytes resp_desc = 6; // response descriptor - int64 call_count = 4; // call counter -} - -message Service // service -{ - int32 rclock = 1; // registration clock - string hname = 2; // host name - string pname = 3; // process name - string uname = 4; // unit name - int32 pid = 5; // process id - string sname = 6; // service name - string sid = 9; // service id - repeated Method methods = 8; // list of methods - - // transport specific parameter (for internal use) - uint32 version = 10; // service protocol version - uint32 tcp_port_v0 = 7; // the tcp port used for that service - uint32 tcp_port_v1 = 11; // the tcp port used for that service -} - -message Client // client -{ - int32 rclock = 1; // registration clock - string hname = 2; // host name - string pname = 3; // process name - string uname = 4; // unit name - int32 pid = 5; // process id - string sname = 6; // service name - string sid = 7; // service id - - // transport specific parameter (for internal use) - uint32 version = 8; // client protocol version -} diff --git a/samples/cpp/monitoring/monitoring_reg/CMakeLists.txt b/samples/cpp/monitoring/monitoring_reg/CMakeLists.txt index 6836b09..43a3318 100644 --- a/samples/cpp/monitoring/monitoring_reg/CMakeLists.txt +++ b/samples/cpp/monitoring/monitoring_reg/CMakeLists.txt @@ -29,19 +29,11 @@ set(monitoring_reg_src src/monitoring_reg.cpp ) -set(monitoring_reg_proto - ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/ecal.proto - ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/host.proto - ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/layer.proto - ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/process.proto - ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/service.proto - ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/topic.proto -) ecal_add_sample(${PROJECT_NAME} ${monitoring_reg_src}) -PROTOBUF_TARGET_CPP(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf ${monitoring_reg_proto}) target_link_libraries(${PROJECT_NAME} eCAL::core + eCAL::core_pb protobuf::libprotobuf ) diff --git a/samples/cpp/monitoring/monitoring_reg/src/monitoring_reg.cpp b/samples/cpp/monitoring/monitoring_reg/src/monitoring_reg.cpp index b314c50..adc8a7f 100644 --- a/samples/cpp/monitoring/monitoring_reg/src/monitoring_reg.cpp +++ b/samples/cpp/monitoring/monitoring_reg/src/monitoring_reg.cpp @@ -24,7 +24,7 @@ #ifdef _MSC_VER #pragma warning(push, 0) #endif -#include +#include #ifdef _MSC_VER #pragma warning(pop) #endif diff --git a/samples/cpp/monitoring/monitoring_reg/src/protobuf/ecal.proto b/samples/cpp/monitoring/monitoring_reg/src/protobuf/ecal.proto deleted file mode 100644 index 8786162..0000000 --- a/samples/cpp/monitoring/monitoring_reg/src/protobuf/ecal.proto +++ /dev/null @@ -1,71 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * 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. - * - * ========================= eCAL LICENSE ================================= -*/ - -syntax = "proto3"; - -import "host.proto"; -import "process.proto"; -import "service.proto"; -import "topic.proto"; - -package eCAL.pb; - -message Content // topic content -{ - int64 id = 1; // sample id - int64 clock = 2; // internal used clock - int64 time = 3; // time the content was updated - bytes payload = 4; // octet stream - int32 size = 6; // size (redundant for compatibility) - int64 hash = 7; // unique hash for that sample -} - -enum eCmdType // command type -{ - bct_none = 0; // undefined command - bct_set_sample = 1; // set sample content - bct_reg_publisher = 2; // register publisher - bct_reg_subscriber = 3; // register subscriber - bct_reg_process = 4; // register process - bct_reg_service = 5; // register service - bct_reg_client = 6; // register client - - bct_unreg_publisher = 12; // unregister publisher - bct_unreg_subscriber = 13; // unregister subscriber - bct_unreg_process = 14; // unregister process - bct_unreg_service = 15; // unregister service - bct_unreg_client = 16; // unregister client -} - -message Sample // a sample is a topic, it's descriptions and it's content -{ - eCmdType cmd_type = 1; // sample command type - Host host = 2; // host information - Process process = 3; // process information - Service service = 4; // service information - Client client = 7; // client information - Topic topic = 5; // topic information - Content content = 6; // topic content - bytes padding = 8; // padding to artificially increase the size of the message. This is a workaround for TCP topics, to get the actual user-payload 8-byte-aligned. REMOVE ME IN ECAL6 -} - -message SampleList -{ - repeated Sample samples = 1; // list of Samples used currently by SHM registration -} diff --git a/samples/cpp/monitoring/monitoring_reg/src/protobuf/host.proto b/samples/cpp/monitoring/monitoring_reg/src/protobuf/host.proto deleted file mode 100644 index f16fdfe..0000000 --- a/samples/cpp/monitoring/monitoring_reg/src/protobuf/host.proto +++ /dev/null @@ -1,33 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * 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. - * - * ========================= eCAL LICENSE ================================= -*/ - -syntax = "proto3"; - -package eCAL.pb; - -message OSInfo // operating system details -{ - string osname = 1; // name -} - -message Host // eCAL host -{ - string hname = 1; // host name - OSInfo os = 2; // operating system details -} diff --git a/samples/cpp/monitoring/monitoring_reg/src/protobuf/layer.proto b/samples/cpp/monitoring/monitoring_reg/src/protobuf/layer.proto deleted file mode 100644 index b6af045..0000000 --- a/samples/cpp/monitoring/monitoring_reg/src/protobuf/layer.proto +++ /dev/null @@ -1,64 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * 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. - * - * ========================= eCAL LICENSE ================================= -*/ - -syntax = "proto3"; - -package eCAL.pb; - -message LayerParUdpMC -{ -} - -message LayerParShm -{ - repeated string memory_file_list = 1; // list of memory file names -} - -message LayerParTcp -{ - int32 port = 1; // tcp writers port number -} - -message ConnnectionPar // connection parameter for reader / writer -{ - LayerParUdpMC layer_par_udpmc = 1; // parameter for ecal udp multicast - LayerParShm layer_par_shm = 2; // parameter for ecal shared memory - // 3 = parameter for ecal inner process - LayerParTcp layer_par_tcp = 4; // parameter for ecal tcp -} - -enum eTLayerType // transport layer -{ - tl_none = 0; // undefined - tl_ecal_udp_mc = 1; // ecal udp multicast - // 2 = ecal udp unicast (not supported anymore) - // 3 = ecal udp metal (not supported anymore) - tl_ecal_shm = 4; // ecal shared memory - tl_ecal_tcp = 5; // ecal tcp - // 42 = inproc (not supported anymore) - tl_all = 255; // all layer -} - -message TLayer -{ - eTLayerType type = 1; // transport layer type - int32 version = 2; // transport layer version - bool confirmed = 3; // transport layer used ? - ConnnectionPar par_layer = 5; // transport layer parameter -} diff --git a/samples/cpp/monitoring/monitoring_reg/src/protobuf/process.proto b/samples/cpp/monitoring/monitoring_reg/src/protobuf/process.proto deleted file mode 100644 index 903a6c2..0000000 --- a/samples/cpp/monitoring/monitoring_reg/src/protobuf/process.proto +++ /dev/null @@ -1,74 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * 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. - * - * ========================= eCAL LICENSE ================================= -*/ - -syntax = "proto3"; - -package eCAL.pb; - -enum eProcessSeverity // process severity -{ - proc_sev_unknown = 0; // condition unknown - proc_sev_healthy = 1; // process healthy - proc_sev_warning = 2; // process warning level - proc_sev_critical = 3; // process critical - proc_sev_failed = 4; // process failed -} - -enum eProcessSeverityLevel // process severity level -{ - proc_sev_level_unknown = 0; // condition unknown - proc_sev_level1 = 1; // default severity level 1 - proc_sev_level2 = 2; // severity level 2 - proc_sev_level3 = 3; // severity level 3 - proc_sev_level4 = 4; // severity level 4 - proc_sev_level5 = 5; // severity level 5 -} - -message ProcessState // process state -{ - eProcessSeverity severity = 1; // severity - eProcessSeverityLevel severity_level = 3; // severity level - string info = 2; // info string -} - -enum eTSyncState // time synchronisation -{ - tsync_none = 0; // not synchronized - tsync_realtime = 1; // real time sync mode - tsync_replay = 2; // replay time sync mode -} - -message Process // process -{ - int32 rclock = 1; // registration clock - string hname = 2; // host name - string hgname = 18; // host group name - int32 pid = 3; // process id - string pname = 4; // process name - string uname = 5; // unit name - string pparam = 6; // process parameter - // 10 = data write bytes per sec - // 11 = data read bytes per sec - ProcessState state = 12; // process state info - eTSyncState tsync_state = 13; // time synchronization state - string tsync_mod_name = 14; // time synchronization module name - int32 component_init_state = 15; // eCAL component initialization state (eCAL::Initialize(..)) - string component_init_info = 16; // like comp_init_state as human readable string (pub|sub|srv|mon|log|time|proc) - string ecal_runtime_version = 17; // loaded / runtime eCAL version of a component -} diff --git a/samples/cpp/monitoring/monitoring_reg/src/protobuf/service.proto b/samples/cpp/monitoring/monitoring_reg/src/protobuf/service.proto deleted file mode 100644 index 6c4b591..0000000 --- a/samples/cpp/monitoring/monitoring_reg/src/protobuf/service.proto +++ /dev/null @@ -1,94 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * 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. - * - * ========================= eCAL LICENSE ================================= -*/ - -syntax = "proto3"; - -package eCAL.pb; - -message ServiceHeader -{ - enum eCallState - { - none = 0; - executed = 1; - failed = 2; - } - - string hname = 1; // host name - string sname = 2; // service name - string sid = 7; // service id - string mname = 3; // method name - string error = 4; // error message - int32 id = 5; // session id - eCallState state = 6; // method call state -} - -message Request // client request -{ - ServiceHeader header = 1; // common service header - bytes request = 2; // request payload -} - -message Response // server response -{ - ServiceHeader header = 1; // common service header - bytes response = 2; // response payload - int64 ret_state = 3; // callback return state -} - -message Method // method -{ - string mname = 1; // method name - string req_type = 2; // request type - bytes req_desc = 5; // request descriptor - string resp_type = 3; // response type - bytes resp_desc = 6; // response descriptor - int64 call_count = 4; // call counter -} - -message Service // service -{ - int32 rclock = 1; // registration clock - string hname = 2; // host name - string pname = 3; // process name - string uname = 4; // unit name - int32 pid = 5; // process id - string sname = 6; // service name - string sid = 9; // service id - repeated Method methods = 8; // list of methods - - // transport specific parameter (for internal use) - uint32 version = 10; // service protocol version - uint32 tcp_port_v0 = 7; // the tcp port used for that service - uint32 tcp_port_v1 = 11; // the tcp port used for that service -} - -message Client // client -{ - int32 rclock = 1; // registration clock - string hname = 2; // host name - string pname = 3; // process name - string uname = 4; // unit name - int32 pid = 5; // process id - string sname = 6; // service name - string sid = 7; // service id - - // transport specific parameter (for internal use) - uint32 version = 8; // client protocol version -} diff --git a/samples/cpp/monitoring/monitoring_reg/src/protobuf/topic.proto b/samples/cpp/monitoring/monitoring_reg/src/protobuf/topic.proto deleted file mode 100644 index 5228d7f..0000000 --- a/samples/cpp/monitoring/monitoring_reg/src/protobuf/topic.proto +++ /dev/null @@ -1,61 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2019 Continental Corporation - * - * 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. - * - * ========================= eCAL LICENSE ================================= -*/ - -syntax = "proto3"; - -import "layer.proto"; - -package eCAL.pb; - -message DataTypeInformation -{ - string name = 1; // name of the datatype - string encoding = 2; // encoding of the datatype (e.g. protobuf, flatbuffers, capnproto) - bytes desc = 3; // descriptor information of the datatype (necessary for reflection) -} - -message Topic // eCAL topic -{ - int32 rclock = 1; // registration clock (heart beat) - string hname = 2; // host name - string hgname = 28; // host group name - int32 pid = 3; // process id - string pname = 4; // process name - string uname = 5; // unit name - string tid = 6; // topic id - string tname = 7; // topic name - string direction = 8; // direction (publisher, subscriber) - string ttype = 9; // topic type + topic encoding (deprecated) - bytes tdesc = 10; // topic description (protocol descriptor) (deprecated) - - DataTypeInformation tdatatype = 30; // topic datatype information (encoding & type & description) - - repeated TLayer tlayer = 12; // active topic transport layers and it's specific parameter - int32 tsize = 13; // topic size - - int32 connections_loc = 16; // number of local connected entities - int32 connections_ext = 17; // number of external connected entities - int32 message_drops = 18; // dropped messages - - int64 did = 19; // data send id (publisher setid) - int64 dclock = 20; // data clock (send / receive action) - int32 dfreq = 21; // data frequency (send / receive samples per second) [mHz] - - map attr = 27; // generic topic description -}