Line data Source code
1 : #include "Module/Stateful/Probe/Probe.hpp" 2 : 3 : using namespace spu; 4 : using namespace spu::module; 5 : 6 182 : AProbe::AProbe() 7 : : Stateful() 8 182 : , reporter(nullptr) 9 182 : , str_display(false) 10 : { 11 182 : } 12 : 13 : void 14 2009 : AProbe::check_reporter() 15 : { 16 2009 : if (reporter == nullptr) 17 : { 18 0 : std::stringstream message; 19 0 : message << "'reporter' can't be null, it is required to call 'AProbe::register_reporter()' first."; 20 0 : throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str()); 21 0 : } 22 2009 : } 23 : 24 : void 25 182 : AProbe::proxy_register_probe(const size_t data_size, 26 : const std::type_index data_type, 27 : const std::string& unit, 28 : const size_t buffer_size, 29 : const std::ios_base::fmtflags ff, 30 : const size_t precision) 31 : { 32 182 : this->reporter->register_probe(*this, data_size, data_type, unit, buffer_size, ff, precision); 33 182 : } 34 : 35 : void 36 1729 : AProbe::proxy_probe(const void* data, const size_t frame_id) 37 : { 38 1729 : this->check_reporter(); 39 1729 : this->reporter->probe(*this, data, frame_id); 40 1729 : } 41 : 42 : bool 43 364 : AProbe::get_str_display() const 44 : { 45 364 : return this->str_display; 46 : } 47 : 48 : void 49 0 : AProbe::set_str_display(bool str_display) 50 : { 51 0 : this->str_display = str_display; 52 0 : }