![]() |
VR-Forces 4.7 Class Documentation
|
The DtSampleAggregator allows users to collect up to a fixed number of rows of N columns of doubles. More...
Public Member Functions | |
| DtSampleAggregator (std::size_t numOfSamples, std::size_t numOfFields, const std::string &fileName, bool rowNumInOutput=true) | |
| CTOR Max number of samples to be collected must be provided up front, so that mem allocations don't take up profiling time. | |
| ~DtSampleAggregator () | |
| DTOR. | |
| std::size_t | numSamples () const |
| Max number of samples that the profiler can profile. | |
| std::size_t | currentSample () const |
| std::size_t | numFields () const |
| Number of arrays used to collect samples. | |
| void | addSample (std::size_t field, double sample) |
| Add a sample value for the specified. | |
| void | incrementSample () |
| Move onto the next sample. | |
| void | reset () |
| discard current samples profiled (e.g. to start profiling anew) | |
| double * | samples (std::size_t field) |
| Pointer to array of doubles for a field. | |
| bool | dumped (void) const |
| were stats dumped already? This can happen if the number of samples to be collected exceed the capacity | |
| void | dump () |
| dump the collected samples to a file | |
| void | addToDumpFile (const std::string &str) |
| bool | valid () const |
| Is aggregator valid. | |
Static Public Member Functions | |
| static std::size_t | calculateNumberOfSamples (float estimatedFrequency, float estimatedRunTimeSeconds) |
| Utility function: Given an approximate frequency and a run time in seconds will compute the upper bound on the number of samples needed. | |
Protected Attributes | |
| std::string | myFileName |
| const std::size_t | myNumSamples |
| const std::size_t | myNumFields |
| std::size_t | myCurrentSample |
| double ** | myData |
| bool | isValid |
| std::ofstream | myDumpFile |
| bool | myDumped |
| bool | myRowNumInOutput |
Private Member Functions | |
| DtSampleAggregator () | |
The DtSampleAggregator allows users to collect up to a fixed number of rows of N columns of doubles.
The number of columns and max number of rows are specified at construction, along with a dump filename. If the maximum number of rows is collected, the data is automatically dumped to the file and collection ends. User's can also request that current rows, whatever has been collected, is dumped (and collection stops). Finally, it is possible to 'zero out' the current data set and restart. If rowNumInOutput is true, the row number is included as the first output field. Fields are output in comma-separated rows.
| makVrv::DtSampleAggregator::DtSampleAggregator | ( | std::size_t | numOfSamples, |
| std::size_t | numOfFields, | ||
| const std::string & | fileName, | ||
| bool | rowNumInOutput = true |
||
| ) |
CTOR Max number of samples to be collected must be provided up front, so that mem allocations don't take up profiling time.
| makVrv::DtSampleAggregator::~DtSampleAggregator | ( | ) |
DTOR.
|
private |
|
static |
Utility function: Given an approximate frequency and a run time in seconds will compute the upper bound on the number of samples needed.
| std::size_t makVrv::DtSampleAggregator::numSamples | ( | ) | const |
Max number of samples that the profiler can profile.
| std::size_t makVrv::DtSampleAggregator::currentSample | ( | ) | const |
| std::size_t makVrv::DtSampleAggregator::numFields | ( | ) | const |
Number of arrays used to collect samples.
| void makVrv::DtSampleAggregator::addSample | ( | std::size_t | field, |
| double | sample | ||
| ) |
Add a sample value for the specified.
| void makVrv::DtSampleAggregator::incrementSample | ( | ) |
Move onto the next sample.
| void makVrv::DtSampleAggregator::reset | ( | ) |
discard current samples profiled (e.g. to start profiling anew)
| double* makVrv::DtSampleAggregator::samples | ( | std::size_t | field | ) |
Pointer to array of doubles for a field.
| bool makVrv::DtSampleAggregator::dumped | ( | void | ) | const |
were stats dumped already? This can happen if the number of samples to be collected exceed the capacity
| void makVrv::DtSampleAggregator::dump | ( | ) |
dump the collected samples to a file
| void makVrv::DtSampleAggregator::addToDumpFile | ( | const std::string & | str | ) |
| bool makVrv::DtSampleAggregator::valid | ( | ) | const |
Is aggregator valid.
Will be false if it cannot allocate memory for requested number of samples or if the dump file cannot be written to, etc
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |