Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DmTftLibrary eeprom SX1280Lib filesystem mbed
Fork of MSNV2-Terminal_V1-5 by
Diff: Payload.cpp
- Revision:
- 18:d5e7e56b0a0d
- Parent:
- 16:a15cd98debe7
- Child:
- 19:4b147d8f9164
--- a/Payload.cpp Wed Aug 29 11:43:40 2018 +0000 +++ b/Payload.cpp Thu Aug 30 08:40:16 2018 +0000 @@ -2,10 +2,10 @@ #include "Component.hpp" #include "Payload.hpp" -Payload::Payload(Payload::PAYLOAD_ID id, std::vector<Component> components) : _id(id), _components(components) { - for (std::vector<Component>::iterator it = this->_components.begin(); it != this->_components.end(); it++) { - Component component = *it; - for(std::vector<Channel*>::iterator it = component.getChannels().begin(); it != component.getChannels().end(); it++) { +Payload::Payload(Payload::PAYLOAD_ID id, std::vector<Component*> components) : _id(id), _components(components) { + for (std::vector<Component*>::iterator it = this->_components.begin(); it != this->_components.end(); it++) { + Component* component = *it; + for(std::vector<Channel*>::iterator it = component->getChannels().begin(); it != component->getChannels().end(); it++) { this->_channels.push_back(*it); } } @@ -39,9 +39,9 @@ out << "List of components :\n------------------" << std::endl; //std::vector<const Component>::iterator it; - std::vector< Component>::iterator it; + std::vector< Component*>::iterator it; //for (it = payload._components.begin(); it != payload._components.end(); it++) { - // std::cout << *it << std::endl; + // std::cout << **it << std::endl; //} std::vector<Channel*> channels = payload._channels; @@ -55,8 +55,8 @@ } /* - for (Component component : payload._components) { - out << " (component : " << component << ")"; + for (Component* component : payload._components) { + out << " (component : " << *component << ")"; } for (Channel* channel : payload._channels) {