-
Notifications
You must be signed in to change notification settings - Fork 0
Cursor
The cursor is kind of like an iterator known from the C++ standard library. It is used to transport data from async plugins to Score-P. In contrast to an iterator, the cursor takes care of memory handling for the user.
Suppose you have a Cursor c, then you iterate over your data and use the write() method of the Cursor to write each data point to it.
std::vector<std::pair<ticks, double>> my_data;
for (auto& data : my_data)
{
// if you have a std::pair you can use the stream operator
c << data;
// else you just use write(timestamp, value)
c.write(data.first, data.second);
}
Note:
The
write()method of the cursor is overloaded in such way, that it distinguishes between signed and unsigned integers, and float and double values. However, you should absolutely make sure, that the value type of the metric matches with the type of the value, which is written to the cursor.
Resizes the underlaying vector to new_size.
After calling this function, the following is true:
new_size == size() and capacity() == size()Writes (t,v) data point to the underlying data structure
Note:
In contrast to
void store(chrono::ticks t, T v)it also checks, whether (t,v) is in the temporal range of the measurement and it callsvoid resize(std::size_t)if appropriate.
Convenience method for void write(chrono::ticks t, T v) for pairs.
Convenience method for void write(chrono::ticks t, T v) for pairs.
Writes (t,v) datapoint unchecked to underlying data structure
Returns to current number of data points, the underlying data structure can hold in total.
Returns the amount of stored data points.
Checks whether the given time point in ticks is in the temporal range of the measurement