4 years, 10 months ago.

Can I send a whole class by mail?

I'm not a very experienced programmer, but I would like to know how I could send a whole class using something like mail(), but I only semi-known how to send a struct.

Is there any example available of someone doing this?

I haven't been able to find anything about it...

I'd like to know where you intend to send it as there are some important considerations when you attempt to communicate using increasingly more complex data structures. The big question is does it have any meaning at the destination, for example you could send a pointer from one process to another on the same device, assuming they share the same memory space, but try to do it between devices or between memory spaces on a protected system and the pointer would be meaningless.

posted by Oliver Broad 10 Jun 2019

1 Answer

4 years, 10 months ago.

Hi LB,

The main difference between the class and the struct is:

  • the content of a struct is public in default
  • the content of a class is private in default
  • we can change these settings inside of content with keywords like are "Public: , Private: , etc"

So if you know how with a struct you know how with a class.

This is not with Mail but with Queue but it is similar I think. So you can check this.

Import programCAN_queue_test

Some test about how work with Queue. The target is send repeated messages via CAN-BUS for simulate a basic car communication for testing secondary ECUs

I don't say that code is written correctly but it working and I hope that will help you a little

Best regards

J.