Helper class for the burst_creator node. More...
#include <burst_merger.h>
Public Member Functions | |
void | add (const burst_calc::burst &b) |
BurstMerger () | |
Sets values to their initial states. | |
bool | canPublish () |
void | deletePublished () |
const burst_calc::burst & | getBurst () |
void | update () |
Performs the merge operation after new bursts have been added. | |
void | updateTime (int index, const ros::Time *t) |
Updates the burst checker time pointer for a channel. | |
~BurstMerger () | |
Frees up memory allocated to burst checker time pointers. | |
Private Member Functions | |
burst_calc::burst | merge (const burst_calc::burst &b1, const burst_calc::burst &b2) |
Merges two bursts into a single burst. | |
Private Attributes | |
std::vector< burst_calc::burst > | final_ |
std::vector< burst_calc::burst > | list_ |
boost::array< ros::Time *, 60 > | times_ |
Helper class for the burst_creator node.
Checks for overlapping bursts from each channel. If there are overlapping bursts, they will be merged so duplicates are eliminated.
Definition at line 24 of file burst_merger.h.
Sets values to their initial states.
Definition at line 13 of file burst_merger.cpp.
Frees up memory allocated to burst checker time pointers.
Definition at line 22 of file burst_merger.cpp.
void BurstMerger::add | ( | const burst_calc::burst & | b | ) | [inline] |
Definition at line 32 of file burst_merger.h.
bool BurstMerger::canPublish | ( | ) | [inline] |
Definition at line 33 of file burst_merger.h.
void BurstMerger::deletePublished | ( | ) | [inline] |
Definition at line 35 of file burst_merger.h.
const burst_calc::burst& BurstMerger::getBurst | ( | ) | [inline] |
Definition at line 34 of file burst_merger.h.
burst_calc::burst BurstMerger::merge | ( | const burst_calc::burst & | b1, |
const burst_calc::burst & | b2 | ||
) | [private] |
Merges two bursts into a single burst.
Pre-condition: the time span of the bursts must overlap in some way.
b1 | one of the bursts to be merged |
b2 | the other burst to be merged |
Definition at line 165 of file burst_merger.cpp.
void BurstMerger::update | ( | ) |
Performs the merge operation after new bursts have been added.
First, check all stored bursts and merge any that can be. Then compare all stored bursts against the times to determine if any of them can be published.
Definition at line 37 of file burst_merger.cpp.
void BurstMerger::updateTime | ( | int | index, |
const ros::Time * | t | ||
) |
Updates the burst checker time pointer for a channel.
The pointer either points to the start time of that channel's possible burst, or is null if there is no possible burst.
index | the index of the channel |
t | the time pointer of the channel's burst checker |
Definition at line 142 of file burst_merger.cpp.
std::vector<burst_calc::burst> BurstMerger::final_ [private] |
Definition at line 41 of file burst_merger.h.
std::vector<burst_calc::burst> BurstMerger::list_ [private] |
Definition at line 42 of file burst_merger.h.
boost::array<ros::Time*, 60> BurstMerger::times_ [private] |
Definition at line 43 of file burst_merger.h.