MCPcopy Create free account
hub / github.com/COVESA/vsomeip / send

Method send

implementation/runtime/src/application_impl.cpp:840–869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

838}
839
840void application_impl::send(std::shared_ptr<message> _message) {
841
842 // likely that the user created a message (with `runtime::create_message`) and forgot to set the type
843 // fail here in an obvious way, instead of down-the-line in some client-lookup code
844 if (_message->get_message_type() == message_type_e::MT_UNKNOWN) {
845 VSOMEIP_ERROR_P << "Message [" << hex4(_message->get_service()) << "." << hex4(_message->get_instance()) << "."
846 << hex4(_message->get_method()) << "] has unknown type, cannot send!";
847 return;
848 }
849
850 bool is_request = utility::is_request(_message);
851 if (client_side_logging_
852 && (client_side_logging_filter_.empty()
853 || (1 == client_side_logging_filter_.count(std::make_tuple(_message->get_service(), ANY_INSTANCE)))
854 || (1 == client_side_logging_filter_.count(std::make_tuple(_message->get_service(), _message->get_instance()))))) {
855 VSOMEIP_INFO_P << "(" << hex4(client_) << "): [" << hex4(_message->get_service()) << "." << hex4(_message->get_instance()) << "."
856 << hex4(_message->get_method()) << ":" << hex4(is_request ? session_ : _message->get_session()) << ":"
857 << hex4(is_request ? client_.load() : _message->get_client()) << "] "
858 << "type=" << static_cast<std::uint32_t>(_message->get_message_type()) << " thread=" << std::this_thread::get_id();
859 }
860 if (routing_) {
861 // in case of requests set the request-id (client-id|session-id)
862 if (is_request) {
863 _message->set_client(client_);
864 _message->set_session(get_session(true));
865 }
866 // Always increment the session-id
867 (void)routing_->send(client_, _message, false);
868 }
869}
870
871void application_impl::notify(service_t _service, instance_t _instance, event_t _event, std::shared_ptr<payload> _payload,
872 bool _force) const {

Callers

nothing calls this directly

Calls 12

hex4Function · 0.85
get_idFunction · 0.85
get_methodMethod · 0.80
countMethod · 0.80
get_message_typeMethod · 0.45
get_serviceMethod · 0.45
get_instanceMethod · 0.45
get_sessionMethod · 0.45
loadMethod · 0.45
get_clientMethod · 0.45
set_clientMethod · 0.45
set_sessionMethod · 0.45

Tested by

no test coverage detected