MIRA
|
Visitor class to inspect tapes by channels and/or time interval. More...
#include <fw/TapeVisitor.h>
Classes | |
class | iterator |
Iterator to iterate over all messages in all tapes visited by the visitor. More... | |
struct | MessageInfo |
Info about a message entry in a tape. More... | |
struct | MessageInstance |
Instance of a message from a tape. More... | |
Public Types | |
typedef std::vector< MessageInfo > | MessageMap |
Vector of message informations. More... | |
typedef std::map< std::string, const Tape::ChannelInfo * > | ChannelMap |
Maps channel info to channel names. More... | |
Public Member Functions | |
void | visit (Tape *iTape, Duration first=Duration::negativeInfinity(), Duration last=Duration::infinity(), bool ignoreStartTime=false) |
Visit a tape by specifying an interval of the relative time of the first and the last message. More... | |
void | visit (Tape *iTape, const std::vector< std::string > &channels, Duration first=Duration::negativeInfinity(), Duration last=Duration::infinity(), bool ignoreStartTime=false) |
Same as above, but additionally select which channels to visit. More... | |
Time | getStartTime () const |
Get the common start time of the visit for all tapes. More... | |
void | setStartTime (const Time &start) |
Set the common start time of the visit for all tapes. More... | |
Duration | getFirstMessageTimeOffset () const |
Get the time offset of the first visited message. More... | |
Duration | getLastMessageTimeOffset () const |
Get the time offset of the last visited message. More... | |
Duration | getLastMessageTZOffset () const |
Get the time zone offset of the last visited message. More... | |
uint32 | getMessageCount () const |
Get the number of messages to visit. More... | |
iterator | begin () |
Iterator to the first visited message in a tape. More... | |
iterator | at (Duration timeOffset) |
Iterator to the message at the given offset since start of tape. More... | |
iterator | end () |
Iterator to the end of visited messages. More... | |
iterator | findNextOf (Duration startOffset, const std::string &channel) |
Returns the iterator to the next message from given channel with a time offset of at least startOffset, or end iterator if no more messages of that channel exist in the tape. More... | |
iterator | findNextOf (const iterator &start, const std::string &channel) |
Returns the iterator to the next message from given channel, starting at the given start iterator, or end iterator if no more messages of that channel exist in the tape. More... | |
iterator | findNextOfAnyOf (Duration startOffset, const std::vector< std::string > &channels) |
Returns the iterator to the next message from any of the given channels with a time offset of at least startOffset, or end iterator if no more messages of those channels exist in the tape. More... | |
iterator | findNextOfAnyOf (const iterator &start, const std::vector< std::string > &channels) |
Returns the iterator to the next message from any of the given channels, starting at the given start iterator, or end iterator if no more messages of those channels exist in the tape. More... | |
const ChannelMap & | getChannels () const |
Get a list of the visited channels. More... | |
Protected Member Functions | |
void | addChannel (Tape *tape, const Tape::ChannelInfo *channel, Duration first=Duration::nanoseconds(0), Duration last=Duration::infinity()) |
void | reIndex (Tape *tape, bool ignoreStartTime=false) |
Protected Attributes | |
boost::optional< Time > | mStart |
MessageMap | mMessages |
ChannelMap | mChannels |
Friends | |
class | iterator |
Visitor class to inspect tapes by channels and/or time interval.
All times of messages are relative times to the start time of the visitor. The start time will be the smallest time of all visited tapes. Multiple tapes can be inspected at once. Their times will be merged relative to the smallest time in all tapes. This means if two tapes are recorded with a ten minute delay this delay is also represented in the visitor.
typedef std::vector<MessageInfo> MessageMap |
Vector of message informations.
typedef std::map<std::string, const Tape::ChannelInfo*> ChannelMap |
Maps channel info to channel names.
void visit | ( | Tape * | iTape, |
Duration | first = Duration::negativeInfinity() , |
||
Duration | last = Duration::infinity() , |
||
bool | ignoreStartTime = false |
||
) |
Visit a tape by specifying an interval of the relative time of the first and the last message.
If a start time has been set (either by previous calls to visit(), or by setStartTime()), the default is to adapt the start time to the minimum of the previous start time and this tape's start time. All added messages are then reindexed to adapt their relative time.
[in] | iTape | The tape to visit |
[in] | first | The first offset relative to the start of recording (Where to start our visit) |
[in] | last | The last offset relative to the start of recording (Where to end our visit) |
[in] | ignoreStartTime | Ignore the start time of this tape when re-indexing. Ignoring ALL visited tapes' start times and never setting any common start time will result in invalid start time and messages from different tapes not being ordered properly. |
void visit | ( | Tape * | iTape, |
const std::vector< std::string > & | channels, | ||
Duration | first = Duration::negativeInfinity() , |
||
Duration | last = Duration::infinity() , |
||
bool | ignoreStartTime = false |
||
) |
Same as above, but additionally select which channels to visit.
[in] | iTape | The tape to visit |
[in] | channels | The list of channels to visit |
[in] | first | The first offset relative to the start of recording (Where to start our visit) |
[in] | last | The last offset relative to the start of recording (Where to end our visit) |
[in] | ignoreStartTime | Ignore the start time of this tape when re-indexing. See above. |
|
inline |
Get the common start time of the visit for all tapes.
|
inline |
Set the common start time of the visit for all tapes.
|
inline |
Get the time offset of the first visited message.
|
inline |
Get the time offset of the last visited message.
|
inline |
Get the time zone offset of the last visited message.
|
inline |
Get the number of messages to visit.
|
inline |
Iterator to the first visited message in a tape.
Iterator to the message at the given offset since start of tape.
[in] | timeOffset | The offset of the message |
|
inline |
Iterator to the end of visited messages.
Returns the iterator to the next message from given channel with a time offset of at least startOffset, or end iterator if no more messages of that channel exist in the tape.
Returns the iterator to the next message from given channel, starting at the given start iterator, or end iterator if no more messages of that channel exist in the tape.
|
inline |
Returns the iterator to the next message from any of the given channels with a time offset of at least startOffset, or end iterator if no more messages of those channels exist in the tape.
|
inline |
Returns the iterator to the next message from any of the given channels, starting at the given start iterator, or end iterator if no more messages of those channels exist in the tape.
|
inline |
Get a list of the visited channels.
|
protected |
|
protected |
|
friend |
|
protected |
|
protected |
|
protected |