#include "cbf_store_pylon.h" namespace solar { cbf_store_pylon::cbf_store_pylon(int msg_id, uint32_t can_id, const byte_vector& _frame, bool _rtr, time_t timestamp) : cb_frame(msg_id, can_id, _frame, _rtr), cbf_store(msg_id, can_id, 0, timestamp, timestamp) { this->id = 0; this->count = 0; // ESP_LOGI(tag("store_pylon CTOR1").c_str(), "%-20s %s", "Created store_pylon", this->to_string().c_str()); } cbf_store_pylon::cbf_store_pylon(const cbf_store_pylon& b) : cb_frame(b), cbf_store(b) // call base class copy constructor { // ESP_LOGI(tag("store_pylon CCTOR").c_str(), "%-20s %s", "Copied store_pylon", this->to_string().c_str()); } cbf_store_pylon& cbf_store_pylon::operator=(const cbf_store_pylon& b) { if (this != &b) { cbf_store_pylon tmp(b); swap(tmp); // ESP_LOGI(tag("store_pylon AOPP").c_str(), "%-20s %s", "Assigned store_pylon", this->to_string().c_str()); } return *this; } cbf_store_pylon::cbf_store_pylon(cbf_store_pylon&& src) : cb_frame(src), cbf_store(src) { src.clear(); // ESP_LOGI(tag("store_pylon MCCTOR").c_str(), "%-20s %s", "Copied store_pylon", this->to_string().c_str()); } cbf_store_pylon& cbf_store_pylon::operator=(cbf_store_pylon&& src) { if (this != &src) { cbf_store::operator=(std::move(src)); cb_frame::operator=(std::move(src)); src.clear(); // ESP_LOGI(tag("store_pylon MOASS").c_str(), "%-20s %s", "Assigned store_pylon", this->to_string().c_str()); } return *this; } std::shared_ptr cbf_store_pylon::clone() const { return std::static_pointer_cast(clone_impl()); // static_pointer_cast is safe here because we know the underlying type is cbf_store_pylon } std::shared_ptr cbf_store_pylon::clone_impl() const { //ESP_LOGI(tag("store_pylon CLONE").c_str(), "%-20s", "Cloning store_pylon"); return std::make_shared(*this); } void cbf_store_pylon::clear() { cb_frame::clear(); cbf_store::clear(); } void cbf_store_pylon::swap(cbf_store_pylon &s) { cb_frame::swap(s); cbf_store::swap(s); } bool cbf_store_pylon::update(const cbf_store& newitem, bool& publish, const int *comparecolumns) { //ESP_LOGI(tag("store_pylon UPDATE").c_str(), "%-20s %s", "Updating store_pylon", this->to_string().c_str()); return cbf_store::update(newitem, publish_spec, publish, comparecolumns); } std::string cbf_store_pylon::to_string() const { return cbf_store::to_string() + " " + cbf_pylon::to_string(); } } // namespace solar