#include "visualdl/logic/sdk.h" namespace visualdl { namespace components { template void components::Scalar::AddRecord(int id, const std::vector &values) { // add record data auto record = tablet_.AddRecord(); auto entry = record.AddData(); for (auto v : values) { entry.Add(v); } // set record id record.SetId(id); // set record timestamp record.SetTimeStamp(time(NULL)); } template std::vector ScalarReader::records() const { std::vector res; for (int i = 0; i < reader_.total_records(); i++) { res.push_back(reader_.record(i).data(0)); } return res; } template std::vector ScalarReader::ids() const { std::vector res; for (int i = 0; i < reader_.total_records(); i++) { res.push_back(reader_.record(i).id()); } return res; } template std::vector ScalarReader::timestamps() const { std::vector res; for (int i = 0; i < reader_.total_records(); i++) { res.push_back(reader_.record(i).timestamp()); } return res; } template std::vector ScalarReader::captions() const { return reader_.captions(); } template size_t ScalarReader::size() const { return reader_.total_records(); } template class Scalar; template class Scalar; template class Scalar; template class Scalar; } // namespace components } // namespace visualdl