CARLA
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
carla::client::BlueprintLibrary Class Reference

#include <BlueprintLibrary.h>

+ Inheritance diagram for carla::client::BlueprintLibrary:
+ Collaboration diagram for carla::client::BlueprintLibrary:

Public Types

using const_iterator = decltype(carla::iterator::make_map_values_const_iterator< map_type::const_iterator >(map_type::const_iterator{}))
 
using const_pointer = const value_type *
 
using const_reference = const value_type &
 
using key_type = map_type::key_type
 
using size_type = map_type::size_type
 
using value_type = map_type::mapped_type
 

Public Member Functions

const_reference at (const std::string &key) const
 
const_reference at (size_type pos) const
 
const_iterator begin () const
 
 BlueprintLibrary (const std::vector< rpc::ActorDefinition > &blueprints)
 
 BlueprintLibrary (BlueprintLibrary &&)=default
 
bool empty () const
 
const_iterator end () const
 
SharedPtr< BlueprintLibraryFilter (const std::string &wildcard_pattern) const
 Filters a list of ActorBlueprint with id or tags matching wildcard_pattern. More...
 
const_pointer Find (const std::string &key) const
 
BlueprintLibraryoperator= (BlueprintLibrary &&)=default
 
const_reference operator[] (size_type pos) const
 
size_type size () const
 

Private Types

using map_type = std::unordered_map< std::string, ActorBlueprint >
 

Private Member Functions

 BlueprintLibrary (map_type blueprints)
 
- Private Member Functions inherited from carla::MovableNonCopyable
 MovableNonCopyable ()=default
 
 MovableNonCopyable (const MovableNonCopyable &)=delete
 
 MovableNonCopyable (MovableNonCopyable &&)=default
 
MovableNonCopyableoperator= (const MovableNonCopyable &)=delete
 
MovableNonCopyableoperator= (MovableNonCopyable &&)=default
 

Private Attributes

map_type _blueprints
 

Detailed Description

Todo:
Works as a list but its actually a map.

We should assess the use cases and reconsider this implementation.

Definition at line 24 of file BlueprintLibrary.h.

Member Typedef Documentation

◆ const_iterator

using carla::client::BlueprintLibrary::const_iterator = decltype(carla::iterator::make_map_values_const_iterator<map_type::const_iterator>(map_type::const_iterator{}))

Definition at line 34 of file BlueprintLibrary.h.

◆ const_pointer

Definition at line 36 of file BlueprintLibrary.h.

◆ const_reference

Definition at line 35 of file BlueprintLibrary.h.

◆ key_type

using carla::client::BlueprintLibrary::key_type = map_type::key_type

Definition at line 31 of file BlueprintLibrary.h.

◆ map_type

using carla::client::BlueprintLibrary::map_type = std::unordered_map<std::string, ActorBlueprint>
private

Definition at line 27 of file BlueprintLibrary.h.

◆ size_type

using carla::client::BlueprintLibrary::size_type = map_type::size_type

Definition at line 33 of file BlueprintLibrary.h.

◆ value_type

using carla::client::BlueprintLibrary::value_type = map_type::mapped_type

Definition at line 32 of file BlueprintLibrary.h.

Constructor & Destructor Documentation

◆ BlueprintLibrary() [1/3]

carla::client::BlueprintLibrary::BlueprintLibrary ( const std::vector< rpc::ActorDefinition > &  blueprints)
explicit

Definition at line 17 of file BlueprintLibrary.cpp.

References _blueprints.

Referenced by Filter().

+ Here is the caller graph for this function:

◆ BlueprintLibrary() [2/3]

carla::client::BlueprintLibrary::BlueprintLibrary ( BlueprintLibrary &&  )
default

◆ BlueprintLibrary() [3/3]

carla::client::BlueprintLibrary::BlueprintLibrary ( map_type  blueprints)
inlineprivate

Definition at line 80 of file BlueprintLibrary.h.

Member Function Documentation

◆ at() [1/2]

BlueprintLibrary::const_reference carla::client::BlueprintLibrary::at ( const std::string &  key) const
Exceptions
std::out_of_rangeif no such element exists.

Definition at line 41 of file BlueprintLibrary.cpp.

References _blueprints, and carla::throw_exception().

Referenced by operator[]().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ at() [2/2]

BlueprintLibrary::const_reference carla::client::BlueprintLibrary::at ( size_type  pos) const
Warning
Linear complexity.
Exceptions
std::out_of_rangeif !(pos < size()).

Definition at line 50 of file BlueprintLibrary.cpp.

References operator[](), size(), and carla::throw_exception().

+ Here is the call graph for this function:

◆ begin()

const_iterator carla::client::BlueprintLibrary::begin ( ) const
inline

Definition at line 62 of file BlueprintLibrary.h.

References _blueprints, and carla::iterator::make_map_values_const_iterator().

+ Here is the call graph for this function:

◆ empty()

bool carla::client::BlueprintLibrary::empty ( ) const
inline

Definition at line 70 of file BlueprintLibrary.h.

References _blueprints.

◆ end()

const_iterator carla::client::BlueprintLibrary::end ( ) const
inline

Definition at line 66 of file BlueprintLibrary.h.

References _blueprints, and carla::iterator::make_map_values_const_iterator().

+ Here is the call graph for this function:

◆ Filter()

SharedPtr< BlueprintLibrary > carla::client::BlueprintLibrary::Filter ( const std::string &  wildcard_pattern) const

Filters a list of ActorBlueprint with id or tags matching wildcard_pattern.

Definition at line 25 of file BlueprintLibrary.cpp.

References _blueprints, and BlueprintLibrary().

+ Here is the call graph for this function:

◆ Find()

BlueprintLibrary::const_pointer carla::client::BlueprintLibrary::Find ( const std::string &  key) const

Definition at line 36 of file BlueprintLibrary.cpp.

References _blueprints.

◆ operator=()

BlueprintLibrary& carla::client::BlueprintLibrary::operator= ( BlueprintLibrary &&  )
default

◆ operator[]()

const_reference carla::client::BlueprintLibrary::operator[] ( size_type  pos) const
inline
Warning
Linear complexity.

Definition at line 53 of file BlueprintLibrary.h.

References _blueprints, and at().

Referenced by at().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ size()

size_type carla::client::BlueprintLibrary::size ( ) const
inline

Definition at line 74 of file BlueprintLibrary.h.

References _blueprints.

Referenced by at().

+ Here is the caller graph for this function:

Member Data Documentation

◆ _blueprints

map_type carla::client::BlueprintLibrary::_blueprints
private

Definition at line 83 of file BlueprintLibrary.h.

Referenced by at(), begin(), BlueprintLibrary(), empty(), end(), Filter(), Find(), operator[](), and size().


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