Apollo  6.0
Open source self driving car software
Public Member Functions | List of all members
apollo::planning::IndexedList< I, T > Class Template Reference

#include <indexed_list.h>

Inheritance diagram for apollo::planning::IndexedList< I, T >:
Inheritance graph
Collaboration diagram for apollo::planning::IndexedList< I, T >:
Collaboration graph

Public Member Functions

T * Add (const I id, const T &object)
 copy object into the container. If the id is already exist, overwrite the object in the container. More...
 
T * Find (const I id)
 Find object by id in the container. More...
 
const T * Find (const I id) const
 Find object by id in the container. More...
 
const std::vector< const T * > & Items () const
 List all the items in the container. More...
 
const std::unordered_map< I, T > & Dict () const
 List all the items in the container. More...
 
IndexedListoperator= (const IndexedList &other)
 Copy the container with objects. More...
 

Member Function Documentation

◆ Add()

template<typename I, typename T>
T* apollo::planning::IndexedList< I, T >::Add ( const I  id,
const T &  object 
)
inline

copy object into the container. If the id is already exist, overwrite the object in the container.

Parameters
idthe id of the object
objectthe const reference of the objected to be copied to the container.
Returns
The pointer to the object in the container.

◆ Dict()

template<typename I, typename T>
const std::unordered_map<I, T>& apollo::planning::IndexedList< I, T >::Dict ( ) const
inline

List all the items in the container.

Returns
the unordered_map of ids and objects in the container.

◆ Find() [1/2]

template<typename I, typename T>
T* apollo::planning::IndexedList< I, T >::Find ( const I  id)
inline

Find object by id in the container.

Parameters
idthe id of the object
Returns
the raw pointer to the object if found.
nullptr if the object is not found.

◆ Find() [2/2]

template<typename I, typename T>
const T* apollo::planning::IndexedList< I, T >::Find ( const I  id) const
inline

Find object by id in the container.

Parameters
idthe id of the object
Returns
the raw pointer to the object if found.
nullptr if the object is not found.

◆ Items()

template<typename I, typename T>
const std::vector<const T*>& apollo::planning::IndexedList< I, T >::Items ( ) const
inline

List all the items in the container.

Returns
the list of const raw pointers of the objects in the container.

◆ operator=()

template<typename I, typename T>
IndexedList& apollo::planning::IndexedList< I, T >::operator= ( const IndexedList< I, T > &  other)
inline

Copy the container with objects.


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