27 #ifndef CONNECTION_DATA_LOGGER_H 28 #define CONNECTION_DATA_LOGGER_H 34 #include "dictdatum.h" 46 typedef nest::index recorder_port;
51 void get_status(DictionaryDatum& d, recorder_port port)
const;
52 void set_status(
const DictionaryDatum& d, recorder_port& port);
65 std::vector<double> recorder_times_;
66 std::vector< std::vector<double> > recorder_values_;
72 std::vector< RecorderData* > recorder_data_;
73 std::vector< Name > recorder_names_;
79 template<
typename ConnectionType>
83 typedef double ( ConnectionType::*DataAccessFct )()
const;
85 void register_recordable_variable(
const Name& name, DataAccessFct data_access_fct);
86 void record(
double time, ConnectionType
const& host, recorder_port port);
89 std::vector< DataAccessFct > data_access_fct_;
103 template<
typename ConnectionType>
105 DataAccessFct data_access_fct)
107 recorder_names_.push_back(name);
108 data_access_fct_.push_back(data_access_fct);
119 template<
typename ConnectionType>
121 ConnectionType
const& host,
124 if (port == nest::invalid_index)
127 assert(port < recorder_data_.size());
130 if (recorder.interval_ == 0)
133 if (recorder.recorder_times_.empty() || (recorder.recorder_times_.back() + recorder.interval_ <= time_step))
135 recorder.recorder_times_.push_back(time_step);
137 for (
size_t i = 0; i < recorder.recorder_values_.size(); i++)
139 recorder.recorder_values_[i].push_back(((host).*(data_access_fct_[i]))());
RecorderData(size_t size)
Definition: connection_data_logger.cpp:146
void set_status(const DictionaryDatum &d, recorder_port &port)
Definition: connection_data_logger.cpp:86
Generic version of data logger for connections.
Definition: connection_data_logger.h:80
void register_recordable_variable(const Name &name, DataAccessFct data_access_fct)
Definition: connection_data_logger.h:104
void record(double time, ConnectionType const &host, recorder_port port)
Definition: connection_data_logger.h:120
recorder_port add_recordable_connection()
Definition: connection_data_logger.cpp:115
void get_status(DictionaryDatum &d, recorder_port port) const
Definition: connection_data_logger.cpp:63
~ConnectionDataLoggerBase()
Definition: connection_data_logger.cpp:47
Global namespace holding all classes of the SPORE NEST module.
Definition: circular_buffer.h:31
void clear()
Definition: connection_data_logger.cpp:157
ConnectionDataLoggerBase()
Definition: connection_data_logger.cpp:40
Base class to all data loggers for connections.
Definition: connection_data_logger.h:43
Data structure that holds the recorded data.
Definition: connection_data_logger.h:60
void clear()
Definition: connection_data_logger.cpp:127