-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added SAttr + -builder to Registration.
- Loading branch information
Showing
25 changed files
with
549 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* ========================= eCAL LICENSE ================================= | ||
* | ||
* Copyright (C) 2016 - 2024 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 ================================= | ||
*/ | ||
|
||
#include "registration_attribute_builder.h" | ||
|
||
namespace eCAL | ||
{ | ||
Registration::SAttr BuildRegistrationAttr(eCAL::Registration::Configuration reg_config_, eCAL::TransportLayer::UDP::Configuration tl_udp_confi_, int process_id_) | ||
{ | ||
Registration::SAttr attr; | ||
|
||
attr.refresh = reg_config_.registration_refresh; | ||
attr.network_enabled = reg_config_.network_enabled; | ||
attr.loopback = reg_config_.loopback; | ||
attr.host_group_name = reg_config_.host_group_name; | ||
attr.process_id = process_id_; | ||
|
||
attr.shm_enabled = reg_config_.layer.shm.enable; | ||
attr.udp_enabled = reg_config_.layer.udp.enable; | ||
|
||
attr.shm.domain = reg_config_.layer.shm.domain; | ||
attr.shm.queue_size = reg_config_.layer.shm.queue_size; | ||
|
||
attr.udp.port = reg_config_.layer.udp.port; | ||
attr.udp.sendbuffer = tl_udp_confi_.send_buffer; | ||
attr.udp.receivebuffer = tl_udp_confi_.receive_buffer; | ||
attr.udp.mode = tl_udp_confi_.mode; | ||
|
||
attr.udp.network.group = tl_udp_confi_.network.group; | ||
attr.udp.network.ttl = tl_udp_confi_.network.ttl; | ||
|
||
attr.udp.local.group = tl_udp_confi_.local.group; | ||
attr.udp.local.ttl = tl_udp_confi_.local.ttl; | ||
|
||
return attr; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* ========================= eCAL LICENSE ================================= | ||
* | ||
* Copyright (C) 2016 - 2024 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 ================================= | ||
*/ | ||
|
||
#ifndef REGISTRATION_BUILDER_H | ||
#define REGISTRATION_BUILDER_H | ||
|
||
#include "registration/attributes/registration_attr.h" | ||
|
||
#include <ecal/ecal_config.h> | ||
|
||
namespace eCAL | ||
{ | ||
Registration::SAttr BuildRegistrationAttr(eCAL::Registration::Configuration reg_config_, eCAL::TransportLayer::UDP::Configuration tl_udp_confi_, int process_id_); | ||
} | ||
|
||
|
||
#endif // REGISTRATION_BUILDER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* ========================= eCAL LICENSE ================================= | ||
* | ||
* Copyright (C) 2016 - 2024 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 ================================= | ||
*/ | ||
|
||
#ifndef REGISTRATION_PROVIDER_ATTR_H | ||
#define REGISTRATION_PROVIDER_ATTR_H | ||
|
||
#include <string> | ||
#include <ecal/types/ecal_custom_data_types.h> | ||
|
||
namespace eCAL | ||
{ | ||
namespace Registration | ||
{ | ||
struct SUDPModeAttr | ||
{ | ||
std::string group; | ||
int ttl; | ||
}; | ||
|
||
struct SUDPAttr | ||
{ | ||
Types::UDPMode mode; | ||
int port; | ||
int sendbuffer; | ||
int receivebuffer; | ||
SUDPModeAttr network; | ||
SUDPModeAttr local; | ||
}; | ||
|
||
struct SSHMAttr | ||
{ | ||
std::string domain; | ||
size_t queue_size; | ||
}; | ||
|
||
struct SAttr | ||
{ | ||
bool network_enabled; | ||
bool loopback; | ||
bool shm_enabled; | ||
bool udp_enabled; | ||
unsigned int refresh; | ||
std::string host_group_name; | ||
int process_id; | ||
|
||
SUDPAttr udp; | ||
SSHMAttr shm; | ||
}; | ||
} | ||
} | ||
|
||
#endif // REGISTRATION_PROVIDER_ATTR_H |
42 changes: 42 additions & 0 deletions
42
ecal/core/src/registration/attributes/sample_applier_attr.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* ========================= eCAL LICENSE ================================= | ||
* | ||
* Copyright (C) 2016 - 2024 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 ================================= | ||
*/ | ||
|
||
#ifndef SAMPLE_APPLIER_ATTR_H | ||
#define SAMPLE_APPLIER_ATTR_H | ||
|
||
#include <string> | ||
|
||
namespace eCAL | ||
{ | ||
namespace Registration | ||
{ | ||
namespace SampleApplier | ||
{ | ||
struct SAttr | ||
{ | ||
bool network_enabled; | ||
bool loopback; | ||
std::string host_group_name; | ||
int process_id; | ||
}; | ||
} | ||
} | ||
} | ||
|
||
#endif // SAMPLE_APPLIER_ATTR_H |
41 changes: 41 additions & 0 deletions
41
ecal/core/src/registration/builder/sample_applier_attribute_builder.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* ========================= eCAL LICENSE ================================= | ||
* | ||
* Copyright (C) 2016 - 2024 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 ================================= | ||
*/ | ||
|
||
#include "sample_applier_attribute_builder.h" | ||
|
||
namespace eCAL | ||
{ | ||
namespace Registration | ||
{ | ||
namespace SampleApplier | ||
{ | ||
SAttr BuildSampleApplierAttr(const Registration::SAttr& attr_) | ||
{ | ||
SAttr sample_applier_attr; | ||
|
||
sample_applier_attr.network_enabled = attr_.network_enabled; | ||
sample_applier_attr.loopback = attr_.loopback; | ||
sample_applier_attr.host_group_name = attr_.host_group_name; | ||
sample_applier_attr.process_id = attr_.process_id; | ||
|
||
return sample_applier_attr; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.