pcl::SetIfFieldExists< PointOutT, InT > Struct Template Reference

A helper functor that can set a specific value in a field if the field exists. More...

`#include <pcl/point_traits.h>`

## Public Types

typedef traits::POD< PointOutT >::type | Pod

## Public Member Functions

| SetIfFieldExists (PointOutT &pt, const std::string &field, const InT &value)
| Constructor. More...
template<typename Key >
void | operator() ()
| Operator. More...

## Detailed Description

### template<typename PointOutT, typename InT>
struct pcl::SetIfFieldExists< PointOutT, InT >

A helper functor that can set a specific value in a field if the field exists.

Note
  In order to actually set the value an instance of this functor should be passed to a pcl::for_each_type loop. See the example below.

PointT p;
typedef typename pcl::traits::fieldList<PointT>::type FieldList;
pcl::for_each_type<FieldList> (pcl::SetIfFieldExists<PointT, float> (p, "intensity", 42.0f));

Definition at line 291 of file point_traits.h.

## Member Typedef Documentation

## Pod

template<typename PointOutT , typename InT >

typedef traits::POD<PointOutT>::type pcl::SetIfFieldExists< PointOutT, InT >::Pod

Definition at line 293 of file point_traits.h.

## Constructor & Destructor Documentation

## SetIfFieldExists()

template<typename PointOutT , typename InT >

pcl::SetIfFieldExists< PointOutT, InT >::SetIfFieldExists | ( | PointOutT & | pt,
|  | const std::string & | field,
|  | const InT & | value
| ) |  |

inline

Constructor.

Parameters

  [in] | pt | the input point
  [in] | field | the name of the field
  [out] | value | the value to set

Definition at line 300 of file point_traits.h.

## Member Function Documentation

## operator()()

template<typename PointOutT , typename InT >
template<typename Key >

void pcl::SetIfFieldExists< PointOutT, InT >::operator() | ( |  | ) |

inline

Operator.

Data copy happens here.

Definition at line 309 of file point_traits.h.

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

- /build/pcl-OilVEB/pcl-1.8.1+dfsg1/common/include/pcl/point_traits.h