PX4 Firmware
PX4 Autopilot Software http://px4.io
TimestampedList< T > Class Template Reference

#include <timestamped_list.h>

Collaboration diagram for TimestampedList< T >:

Classes

struct  item_t
 

Public Member Functions

 TimestampedList (int num_items)
 
 ~TimestampedList ()
 
void put (const T &new_value)
 Insert a value into the list, overwrite the oldest entry if full. More...
 
void reset_to_start ()
 Before iterating using get_next(), reset to start. More...
 
T * get_next ()
 Iterate through all active values (not sorted). More...
 
void drop_current ()
 Disable the last item that we have gotten. More...
 
void update_current ()
 Update the timestamp of the item we have gotten. More...
 
 TimestampedList (const TimestampedList &)=delete
 
TimestampedList operator= (const TimestampedList &)=delete
 

Private Attributes

item_t_list = nullptr
 
int _list_len = 0
 
int _current_i = -1
 

Detailed Description

template<class T>
class TimestampedList< T >

Definition at line 53 of file timestamped_list.h.

Constructor & Destructor Documentation

◆ TimestampedList() [1/2]

template<class T>
TimestampedList< T >::TimestampedList ( int  num_items)
inline

Definition at line 56 of file timestamped_list.h.

Referenced by TimestampedList< MavlinkCommandSender::command_item_t >::update_current().

Here is the caller graph for this function:

◆ ~TimestampedList()

template<class T>
TimestampedList< T >::~TimestampedList ( )
inline

Definition at line 62 of file timestamped_list.h.

◆ TimestampedList() [2/2]

template<class T>
TimestampedList< T >::TimestampedList ( const TimestampedList< T > &  )
delete

Member Function Documentation

◆ drop_current()

template<class T>
void TimestampedList< T >::drop_current ( )
inline

Disable the last item that we have gotten.

Definition at line 129 of file timestamped_list.h.

◆ get_next()

template<class T>
T* TimestampedList< T >::get_next ( )
inline

Iterate through all active values (not sorted).

Return nullptr if at end of list.

This is basically a poor man's iterator.

Definition at line 111 of file timestamped_list.h.

◆ operator=()

template<class T>
TimestampedList TimestampedList< T >::operator= ( const TimestampedList< T > &  )
delete

Referenced by TimestampedList< MavlinkCommandSender::command_item_t >::update_current().

Here is the caller graph for this function:

◆ put()

template<class T>
void TimestampedList< T >::put ( const T &  new_value)
inline

Insert a value into the list, overwrite the oldest entry if full.

Definition at line 70 of file timestamped_list.h.

◆ reset_to_start()

template<class T>
void TimestampedList< T >::reset_to_start ( )
inline

Before iterating using get_next(), reset to start.

Definition at line 100 of file timestamped_list.h.

◆ update_current()

template<class T>
void TimestampedList< T >::update_current ( )
inline

Update the timestamp of the item we have gotten.

Definition at line 139 of file timestamped_list.h.

Member Data Documentation

◆ _current_i

◆ _list

◆ _list_len


The documentation for this class was generated from the following file: