Point Cloud Library (PCL)  1.14.1-dev
List of all members | Public Types | Public Member Functions
pcl::CopyIfFieldExists< PointInT, OutT > Struct Template Reference

A helper functor that can copy a specific value if the given field exists. More...

#include <pcl/type_traits.h>

Public Types

using Pod = typename traits::POD< PointInT >::type
 

Public Member Functions

 CopyIfFieldExists (const PointInT &pt, const std::string &field, bool &exists, OutT &value)
 Constructor. More...
 
 CopyIfFieldExists (const PointInT &pt, const std::string &field, OutT &value)
 Constructor. More...
 
template<typename Key >
void operator() ()
 Operator. More...
 

Detailed Description

template<typename PointInT, typename OutT>
struct pcl::CopyIfFieldExists< PointInT, OutT >

A helper functor that can copy a specific value if the given field exists.

Note
In order to actually copy the value an instance of this functor should be passed to a pcl::for_each_type loop. See the example below.
PointInT p;
bool exists;
float value;
using FieldList = typename pcl::traits::fieldList<PointInT>::type;
pcl::for_each_type<FieldList> (pcl::CopyIfFieldExists<PointT, float> (p, "intensity", exists, value));
A helper functor that can copy a specific value if the given field exists.
Definition: type_traits.h:133

Definition at line 132 of file type_traits.h.

Member Typedef Documentation

◆ Pod

template<typename PointInT , typename OutT >
using pcl::CopyIfFieldExists< PointInT, OutT >::Pod = typename traits::POD<PointInT>::type

Definition at line 134 of file type_traits.h.

Constructor & Destructor Documentation

◆ CopyIfFieldExists() [1/2]

template<typename PointInT , typename OutT >
pcl::CopyIfFieldExists< PointInT, OutT >::CopyIfFieldExists ( const PointInT &  pt,
const std::string &  field,
bool &  exists,
OutT &  value 
)
inline

Constructor.

Parameters
[in]ptthe input point
[in]fieldthe name of the field
[out]existsset to true if the field exists, false otherwise
[out]valuethe copied field value

Definition at line 142 of file type_traits.h.

◆ CopyIfFieldExists() [2/2]

template<typename PointInT , typename OutT >
pcl::CopyIfFieldExists< PointInT, OutT >::CopyIfFieldExists ( const PointInT &  pt,
const std::string &  field,
OutT &  value 
)
inline

Constructor.

Parameters
[in]ptthe input point
[in]fieldthe name of the field
[out]valuethe copied field value

Definition at line 156 of file type_traits.h.

Member Function Documentation

◆ operator()()

template<typename PointInT , typename OutT >
template<typename Key >
void pcl::CopyIfFieldExists< PointInT, OutT >::operator() ( )
inline

Operator.

Data copy happens here.

Definition at line 165 of file type_traits.h.


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