Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » How can I have the necessary includes generated automatically?
How can I have the necessary includes generated automatically? [message #1836389] Thu, 31 December 2020 23:52 Go to next message
Manuel Malagon is currently offline Manuel MalagonFriend
Messages: 81
Registered: December 2011
Member
I have the following diagram
index.php/fa/39647/0/

And in the Server's run() method I have
if (m_type == ServerType::USER)
{
    m_clients_list[list_index] = new ha::User(client_address.sin_addr,
                                              m_client_socket,
                                              m_port);
}
else
{
    m_clients_list[list_index] = new ha::Device(client_address.sin_addr,
                                                m_client_socket,
                                                m_port);
}


My issue here is that to be able to compile new ha::User and new ha::Device I need to manually add
#include "iotHub/ha/User.h"
#include "iotHub/ha/Device.h"


To the Server.cpp file like this
index.php/fa/39648/0/

My question is, Is there some stereotype or configuration I can add to any class, package, or diagram so the includes are added automatically?

This is critical because if I change the ha package name to something else then the includes would have to change and I would need to change this manually.
Re: How can I have the necessary includes generated automatically? [message #1836434 is a reply to message #1836389] Mon, 04 January 2021 10:35 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 461
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Hi,

as SW designer does not analyse the code in an opaque behavior, it cannot automatically add the required includes (unlike it does for types referenced in the signature). However, you can add a dependency relationship between your class and the required types and the required #include will be generated.

Ansgar
Re: How can I have the necessary includes generated automatically? [message #1836452 is a reply to message #1836434] Mon, 04 January 2021 16:57 Go to previous message
Manuel Malagon is currently offline Manuel MalagonFriend
Messages: 81
Registered: December 2011
Member
Ansgar Radermacher wrote on Mon, 04 January 2021 05:35
However, you can add a dependency relationship between your class and the required types and the required #include will be generated.


Awesome! That helped!
Previous Topic:[Solved] How to set return type of operation?
Next Topic:Bug: Comment and ret value automatically added when saving diagram
Goto Forum:
  


Current Time: Fri Apr 26 22:28:23 GMT 2024

Powered by FUDForum. Page generated in 0.03119 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top