MRPT  1.9.9
Classes | Macros | Typedefs | Functions
Stlext_grp

Detailed Description

Classes

struct  mrpt::containers::ContainerReadOnlyProxyAccessor< STLCONTAINER >
 A generic proxy accessor template that only allows read-only access to the original binded STL container object. More...
 
class  mrpt::containers::MT_buffer
 This class is a bulk sequence of bytes with MultiThread (MT)-safe read and write operations. More...
 
struct  mrpt::containers::map_traits_stdmap
 Traits for using a std::map<> (sparse representation) More...
 
struct  mrpt::containers::map_traits_map_as_vector
 Traits for using a mrpt::containers::map_as_vector<> (dense, fastest representation) More...
 
struct  mrpt::serialization::metaprogramming::ObjectReadFromStream
 An object for reading objects from a stream, intended for being used in STL algorithms. More...
 
struct  mrpt::serialization::metaprogramming::ObjectReadFromStreamToPtrs< ptr_t >
 
struct  mrpt::serialization::metaprogramming::ObjectWriteToStream
 An object for writing objects to a stream, intended for being used in STL algorithms. More...
 

Macros

#define MRPTSTL_SERIALIZABLE_SEQ_CONTAINER(CONTAINER)
 
#define MRPTSTL_SERIALIZABLE_SIMPLE_ASSOC_CONTAINER(CONTAINER)
 

Typedefs

template<typename T >
using mrpt::serialization::is_map_like = std::is_same< typename T::value_type, std::pair< const typename T::key_type, typename T::mapped_type > >
 
template<typename T >
using mrpt::serialization::is_map = std::is_same< T, typename std::map< typename T::key_type, typename T::mapped_type, typename T::key_compare, typename T::allocator_type > >
 
template<typename T >
using mrpt::serialization::is_multimap = std::is_same< T, typename std::multimap< typename T::key_type, typename T::mapped_type, typename T::key_compare, typename T::allocator_type > >
 

Functions

template<class T , class CONTAINER >
size_t mrpt::containers::find_in_vector (const T &value, const CONTAINER &vect)
 Returns the index of the value "T" in the container "vect" (std::vector,std::deque,etc), or string::npos if not found. More...
 
template<class T >
std::list< T >::iterator mrpt::containers::erase_return_next (std::list< T > &cont, typename std::list< T >::iterator &it)
 Calls the standard "erase" method of a STL container, but also returns an iterator to the next element in the container (or end if none) More...
 
template<class K , class V >
std::map< K, V >::iterator mrpt::containers::erase_return_next (std::map< K, V > &cont, typename std::map< K, V >::iterator &it)
 
template<class K , class V >
std::multimap< K, V >::iterator mrpt::containers::erase_return_next (std::multimap< K, V > &cont, typename std::multimap< K, V >::iterator &it)
 
template<class T >
std::set< T >::iterator mrpt::containers::erase_return_next (std::set< T > &cont, typename std::set< T >::iterator &it)
 
template<class T >
std::string mrpt::containers::getSTLContainerAsString (const T &t)
 Return a STL container in std::string form. More...
 
template<class T >
void mrpt::containers::printSTLContainer (const T &t)
 Print the given vector t. More...
 
template<class T >
void mrpt::containers::printSTLContainerOfContainers (const T &t)
 Print the given STL container of containers t. More...
 
template<class T1 , class T2 >
std::string mrpt::containers::getMapAsString (const std::map< T1, T2 > &m, const std::string &sep=" => ")
 Return contents of map in a string representation. More...
 
template<class T1 , class T2 >
void mrpt::containers::printMap (const std::map< T1, T2 > &m)
 Print the given map m. More...
 
template<class CONTAINER >
void mrpt::containers::deep_clear (CONTAINER &c)
 Deep clear for a std vector container. More...
 
template<class T >
CArchivemrpt::serialization::operator<< (CArchive &out, const std::optional< T > &obj)
 Template to serialize a std::optional<T> More...
 
template<class T >
CArchivemrpt::serialization::operator>> (CArchive &in, std::optional< T > &obj)
 Template to deserialize a std::optional<T> More...
 
template<typename T , std::enable_if_t< is_map< T >::value, int > = 0>
std::string mrpt::serialization::containerName ()
 
template<typename T , std::enable_if_t< is_simple_type< T >::value, int > = 0>
CArchivemrpt::serialization::operator<< (CArchive &out, const T &obj)
 Template method to serialize an associative STL container. More...
 
template<typename T , std::enable_if_t< is_simple_type< T >::value, int > = 0>
CArchivemrpt::serialization::operator>> (CArchive &in, T &obj)
 Template method to deserialize an associative STL container. More...
 
template<class T , size_t N>
CArchivemrpt::serialization::operator<< (CArchive &out, const std::array< T, N > &obj)
 Template method to serialize a std::array<T,N> More...
 
template<class T , size_t N>
CArchivemrpt::serialization::operator>> (CArchive &in, std::array< T, N > &obj)
 Template method to deserialize a std::array<T,N> More...
 
template<class T1 , class T2 >
CArchivemrpt::serialization::operator<< (CArchive &out, const std::pair< T1, T2 > &obj)
 Template method to serialize a STL pair. More...
 
template<class T1 , class T2 >
CArchivemrpt::serialization::operator>> (CArchive &in, std::pair< T1, T2 > &obj)
 Template method to deserialize a STL pair. More...
 

Macro Definition Documentation

◆ MRPTSTL_SERIALIZABLE_SEQ_CONTAINER

#define MRPTSTL_SERIALIZABLE_SEQ_CONTAINER (   CONTAINER)

Definition at line 27 of file stl_serialization.h.

◆ MRPTSTL_SERIALIZABLE_SIMPLE_ASSOC_CONTAINER

#define MRPTSTL_SERIALIZABLE_SIMPLE_ASSOC_CONTAINER (   CONTAINER)

Definition at line 155 of file stl_serialization.h.

Typedef Documentation

◆ is_map

template<typename T >
using mrpt::serialization::is_map = typedef std::is_same< T, typename std::map< typename T::key_type, typename T::mapped_type, typename T::key_compare, typename T::allocator_type> >

Definition at line 77 of file stl_serialization.h.

◆ is_map_like

template<typename T >
using mrpt::serialization::is_map_like = typedef std::is_same< typename T::value_type, std::pair<const typename T::key_type, typename T::mapped_type> >

Definition at line 71 of file stl_serialization.h.

◆ is_multimap

template<typename T >
using mrpt::serialization::is_multimap = typedef std::is_same< T, typename std::multimap< typename T::key_type, typename T::mapped_type, typename T::key_compare, typename T::allocator_type> >

Definition at line 83 of file stl_serialization.h.

Function Documentation

◆ containerName()

template<typename T , std::enable_if_t< is_map< T >::value, int > = 0>
std::string mrpt::serialization::containerName ( )

Definition at line 86 of file stl_serialization.h.

◆ deep_clear()

template<class CONTAINER >
void mrpt::containers::deep_clear ( CONTAINER &  c)

Deep clear for a std vector container.

Definition at line 139 of file stl_containers_utils.h.

References mrpt::containers::empty().

Referenced by mrpt::system::CTimeLogger::clear(), and mrpt::obs::CObservationVelodyneScan::TPointCloud::clear_deep().

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

◆ erase_return_next() [1/4]

template<class T >
std::list<T>::iterator mrpt::containers::erase_return_next ( std::list< T > &  cont,
typename std::list< T >::iterator &  it 
)
inline

Calls the standard "erase" method of a STL container, but also returns an iterator to the next element in the container (or end if none)

Definition at line 37 of file stl_containers_utils.h.

Referenced by mrpt::vision::TSequenceFeatureObservations::decimateCameraFrames(), and mrpt::hmtslam::CHMTSLAM::LSLAM_process_message_from_AA().

Here is the caller graph for this function:

◆ erase_return_next() [2/4]

template<class K , class V >
std::map<K, V>::iterator mrpt::containers::erase_return_next ( std::map< K, V > &  cont,
typename std::map< K, V >::iterator &  it 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 44 of file stl_containers_utils.h.

◆ erase_return_next() [3/4]

template<class K , class V >
std::multimap<K, V>::iterator mrpt::containers::erase_return_next ( std::multimap< K, V > &  cont,
typename std::multimap< K, V >::iterator &  it 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 54 of file stl_containers_utils.h.

◆ erase_return_next() [4/4]

template<class T >
std::set<T>::iterator mrpt::containers::erase_return_next ( std::set< T > &  cont,
typename std::set< T >::iterator &  it 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 64 of file stl_containers_utils.h.

◆ find_in_vector()

template<class T , class CONTAINER >
size_t mrpt::containers::find_in_vector ( const T &  value,
const CONTAINER &  vect 
)

Returns the index of the value "T" in the container "vect" (std::vector,std::deque,etc), or string::npos if not found.

Definition at line 26 of file stl_containers_utils.h.

References mrpt::math::distance().

Referenced by mrpt::slam::CRangeBearingKFSLAM2D::OnGetObservationsAndDataAssociation(), mrpt::graphslam::optimize_graph_spa_levmarq(), and mrpt::bayes::CKalmanFilterCapable< 7, 3, 3, 7 >::runOneKalmanIteration().

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

◆ getMapAsString()

template<class T1 , class T2 >
std::string mrpt::containers::getMapAsString ( const std::map< T1, T2 > &  m,
const std::string sep = " => " 
)

Return contents of map in a string representation.

Parameters
[in]mTemplate map
[in]sepString that seperates visually each key and its value. Defaults to " => "
Returns
std::string representation of map

Definition at line 118 of file stl_containers_utils.h.

Referenced by mrpt::containers::printMap().

Here is the caller graph for this function:

◆ getSTLContainerAsString()

template<class T >
std::string mrpt::containers::getSTLContainerAsString ( const T &  t)

Return a STL container in std::string form.

Parameters
[in]tTemplate STL container (e.g. vector)
Returns
String form of given STL container

Definition at line 79 of file stl_containers_utils.h.

Referenced by mrpt::graphslam::deciders::CLoopCloserERD< GRAPH_T >::checkPartitionsForLC(), mrpt::graphslam::deciders::CLoopCloserERD< GRAPH_T >::generateHypotsPool(), mrpt::graphslam::deciders::CLoopCloserERD< GRAPH_T >::generatePWConsistenciesMatrix(), mrpt::graphslam::TUncertaintyPath< GRAPH_T >::getAsString(), and mrpt::containers::printSTLContainer().

Here is the caller graph for this function:

◆ operator<<() [1/4]

template<class T >
CArchive& mrpt::serialization::operator<< ( CArchive out,
const std::optional< T > &  obj 
)

Template to serialize a std::optional<T>

Definition at line 22 of file optional_serialization.h.

References mrpt::typemeta::TTypeName< T >::get(), and out.

Here is the call graph for this function:

◆ operator<<() [2/4]

template<class T , size_t N>
CArchive& mrpt::serialization::operator<< ( CArchive out,
const std::array< T, N > &  obj 
)

Template method to serialize a std::array<T,N>

Definition at line 208 of file stl_serialization.h.

References out.

◆ operator<<() [3/4]

template<class T1 , class T2 >
CArchive& mrpt::serialization::operator<< ( CArchive out,
const std::pair< T1, T2 > &  obj 
)

Template method to serialize a STL pair.

Definition at line 242 of file stl_serialization.h.

References mrpt::typemeta::TTypeName< T >::get(), and out.

Here is the call graph for this function:

◆ operator<<() [4/4]

template<typename T , std::enable_if_t< is_simple_type< T >::value, int > = 0>
CArchive & mrpt::serialization::operator<< ( CArchive out,
const T &  a 
)

Template method to serialize an associative STL container.

Definition at line 427 of file CArchive.h.

References out.

◆ operator>>() [1/4]

template<class T >
CArchive& mrpt::serialization::operator>> ( CArchive in,
std::optional< T > &  obj 
)

Template to deserialize a std::optional<T>

Definition at line 32 of file optional_serialization.h.

References mrpt::format(), mrpt::typemeta::TTypeName< T >::get(), THROW_EXCEPTION, and val.

Here is the call graph for this function:

◆ operator>>() [2/4]

template<class T , size_t N>
CArchive& mrpt::serialization::operator>> ( CArchive in,
std::array< T, N > &  obj 
)

Template method to deserialize a std::array<T,N>

Definition at line 219 of file stl_serialization.h.

References mrpt::typemeta::TTypeName< T >::get(), and THROW_EXCEPTION_FMT.

Here is the call graph for this function:

◆ operator>>() [3/4]

template<class T1 , class T2 >
CArchive& mrpt::serialization::operator>> ( CArchive in,
std::pair< T1, T2 > &  obj 
)

Template method to deserialize a STL pair.

Definition at line 251 of file stl_serialization.h.

References mrpt::format(), mrpt::typemeta::TTypeName< T >::get(), and THROW_EXCEPTION.

Here is the call graph for this function:

◆ operator>>() [4/4]

template<typename T , std::enable_if_t< is_simple_type< T >::value, int > = 0>
CArchive & mrpt::serialization::operator>> ( CArchive in,
T &  a 
)

Template method to deserialize an associative STL container.

Definition at line 434 of file CArchive.h.

References mrpt::serialization::CArchive::ReadBuffer().

Here is the call graph for this function:

◆ printMap()

template<class T1 , class T2 >
void mrpt::containers::printMap ( const std::map< T1, T2 > &  m)

Print the given map m.

Parameters
[in]mTemplate map

Definition at line 131 of file stl_containers_utils.h.

References mrpt::containers::getMapAsString().

Here is the call graph for this function:

◆ printSTLContainer()

template<class T >
void mrpt::containers::printSTLContainer ( const T &  t)

Print the given vector t.

Parameters
[in]tTemplate vector

Definition at line 90 of file stl_containers_utils.h.

References mrpt::containers::getSTLContainerAsString().

Referenced by mrpt::containers::printSTLContainerOfContainers().

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

◆ printSTLContainerOfContainers()

template<class T >
void mrpt::containers::printSTLContainerOfContainers ( const T &  t)

Print the given STL container of containers t.

Parameters
[in]tTemplate STL container (containing other containers)

Definition at line 99 of file stl_containers_utils.h.

References mrpt::containers::printSTLContainer().

Here is the call graph for this function:



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 479715d5b Tue Nov 12 07:26:21 2019 +0100 at mar nov 12 07:30:12 CET 2019