Digitalisierte Elektroverteilung zur permanenten Verbraucherüberwachung
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PublisherData.cpp 743B

2 years ago
123456789101112131415161718192021222324252627282930
  1. #include "PublisherData.h"
  2. PublisherData::PublisherData(const int _publisherID, PublisherType pubType, float _value) :
  3. publisherID(_publisherID), publisherType(pubType), values(std::vector<float>())
  4. {
  5. values.push_back(_value);
  6. }
  7. PublisherData::PublisherData(const int _publisherID, PublisherType pubType, std::vector<float> _values) :
  8. publisherID(_publisherID), publisherType(pubType), values(_values)
  9. {
  10. }
  11. PublisherData::PublisherData() :
  12. publisherID(0), publisherType(PublisherType::NA), values({ 0.0 })
  13. {
  14. }
  15. std::ostream& operator<<(std::ostream& os, const PublisherData& data){
  16. for (u_int i = 0; i < data.values.size()-1; i++) {
  17. os << data.values[i] << ",";
  18. }
  19. os << data.values[data.values.size()-1] << ";";
  20. return os;
  21. }