PCL
pcl::Flags< E > Class Template Reference

A type-safe collection of enumerated flags. More...

#include <Flags.h>

+ Inheritance diagram for pcl::Flags< E >:

Public Types

typedef E enum_type
 
typedef FlagType< std::is_unsigned< enum_type >::value >::type flag_type
 

Public Member Functions

 Flags ()=default
 
constexpr Flags (enum_type e)
 
constexpr Flags (flag_type m)
 
 Flags (const Flags &)=default
 
void Clear ()
 
void ClearFlag (enum_type e)
 
constexpr bool IsFlagSet (enum_type e) const
 
constexpr operator flag_type () const
 
constexpr bool operator! () const
 
constexpr Flags operator& (Flags f) const
 
constexpr Flags operator& (enum_type e) const
 
constexpr Flags operator& (unsigned m) const
 
Flagsoperator&= (Flags f)
 
Flagsoperator&= (enum_type e)
 
Flagsoperator&= (unsigned m)
 
Flagsoperator<< (enum_type e)
 
Flagsoperator= (const Flags &)=default
 
Flagsoperator= (enum_type e)
 
constexpr Flags operator^ (Flags f) const
 
constexpr Flags operator^ (enum_type e) const
 
constexpr Flags operator^ (unsigned m) const
 
Flagsoperator^= (Flags f)
 
Flagsoperator^= (enum_type e)
 
Flagsoperator^= (unsigned m)
 
constexpr Flags operator| (Flags f) const
 
constexpr Flags operator| (enum_type e) const
 
constexpr Flags operator| (unsigned m) const
 
Flagsoperator|= (Flags f)
 
Flagsoperator|= (enum_type e)
 
Flagsoperator|= (unsigned m)
 
constexpr Flags operator~ () const
 
void SetFlag (enum_type e, bool on=true)
 

Detailed Description

template<typename E>
class pcl::Flags< E >

TODO: Write a detailed description for Flags.

Definition at line 84 of file Flags.h.

Member Typedef Documentation

◆ enum_type

template<typename E>
typedef E pcl::Flags< E >::enum_type

Represents the enumerated type that defines individual flags.

Definition at line 89 of file Flags.h.

◆ flag_type

template<typename E>
typedef FlagType<std::is_unsigned<enum_type>::value>::type pcl::Flags< E >::flag_type

Represents the integral type used to store flags.

Definition at line 100 of file Flags.h.

Constructor & Destructor Documentation

◆ Flags() [1/4]

template<typename E>
pcl::Flags< E >::Flags ( )
default

Constructs an empty (zero) Flags instance.

◆ Flags() [2/4]

template<typename E>
constexpr pcl::Flags< E >::Flags ( enum_type  e)
inline

Constructs a Flags instance from an enumerated flag value e.

Definition at line 111 of file Flags.h.

◆ Flags() [3/4]

template<typename E>
constexpr pcl::Flags< E >::Flags ( flag_type  m)
inline

Constructs a Flags instance from a mask m.

Definition at line 119 of file Flags.h.

◆ Flags() [4/4]

template<typename E>
pcl::Flags< E >::Flags ( const Flags< E > &  )
default

Copy constructor.

Member Function Documentation

◆ Clear()

template<typename E>
void pcl::Flags< E >::Clear ( )
inline

Clears all flags in this object.

Definition at line 271 of file Flags.h.

◆ ClearFlag()

template<typename E>
void pcl::Flags< E >::ClearFlag ( enum_type  e)
inline

Clears the specified flag e. This is a convenience member function, equivalent to SetFlag( e, false ).

Definition at line 263 of file Flags.h.

◆ IsFlagSet()

template<typename E>
constexpr bool pcl::Flags< E >::IsFlagSet ( enum_type  e) const
inline

Returns true iff the specified flag e is set in this Flags object.

Definition at line 243 of file Flags.h.

◆ operator flag_type()

template<typename E>
constexpr pcl::Flags< E >::operator flag_type ( ) const
inline

Converts this Flags object to an integer.

Definition at line 297 of file Flags.h.

◆ operator!()

template<typename E>
constexpr bool pcl::Flags< E >::operator! ( ) const
inline

Returns true iff all flags in this object are zero.

Definition at line 289 of file Flags.h.

◆ operator&() [1/3]

template<typename E>
constexpr Flags pcl::Flags< E >::operator & ( Flags< E >  f) const
inline

Bitwise AND between two Flags objects.

Definition at line 314 of file Flags.h.

◆ operator&() [2/3]

template<typename E>
constexpr Flags pcl::Flags< E >::operator & ( enum_type  e) const
inline

Bitwise AND between a Flags object and an enumerated value.

Definition at line 322 of file Flags.h.

◆ operator&() [3/3]

template<typename E>
constexpr Flags pcl::Flags< E >::operator & ( unsigned  m) const
inline

Bitwise AND between a Flags object and a mask.

Definition at line 330 of file Flags.h.

◆ operator&=() [1/3]

template<typename E>
Flags& pcl::Flags< E >::operator &= ( Flags< E >  f)
inline

Performs a bitwise AND operation with other flags f and stores the resulting flags in this object. Returns a reference to this object.

Definition at line 147 of file Flags.h.

◆ operator&=() [2/3]

template<typename E>
Flags& pcl::Flags< E >::operator &= ( enum_type  e)
inline

Performs a bitwise AND operation with an enumerated flag value e and stores the resulting flags in this object. Returns a reference to this object.

Definition at line 158 of file Flags.h.

◆ operator&=() [3/3]

template<typename E>
Flags& pcl::Flags< E >::operator &= ( unsigned  m)
inline

Performs a bitwise AND operation with a mask value m and stores the resulting flags in this object. Returns a reference to this object.

Definition at line 168 of file Flags.h.

◆ operator<<()

template<typename E>
Flags& pcl::Flags< E >::operator<< ( enum_type  e)
inline

Sets the specified flag e in this object. Returns a reference to this object.

Definition at line 280 of file Flags.h.

◆ operator=() [1/2]

template<typename E>
Flags& pcl::Flags< E >::operator= ( const Flags< E > &  )
default

Copy assignment operator. Returns a reference to this object.

◆ operator=() [2/2]

template<typename E>
Flags& pcl::Flags< E >::operator= ( enum_type  e)
inline

Assigns an enumerated flag value e to this object. Returns a reference to this object.

Definition at line 137 of file Flags.h.

◆ operator^() [1/3]

template<typename E>
constexpr Flags pcl::Flags< E >::operator^ ( Flags< E >  f) const
inline

Bitwise XOR between two Flags objects.

Definition at line 362 of file Flags.h.

◆ operator^() [2/3]

template<typename E>
constexpr Flags pcl::Flags< E >::operator^ ( enum_type  e) const
inline

Bitwise XOR between a Flags object and an enumerated value.

Definition at line 370 of file Flags.h.

◆ operator^() [3/3]

template<typename E>
constexpr Flags pcl::Flags< E >::operator^ ( unsigned  m) const
inline

Bitwise XOR between a Flags object and a mask.

Definition at line 378 of file Flags.h.

◆ operator^=() [1/3]

template<typename E>
Flags& pcl::Flags< E >::operator^= ( Flags< E >  f)
inline

Performs a bitwise exclusive OR (XOR) operation with other flags f and stores the resulting flags in this object. Returns a reference to this object.

Definition at line 212 of file Flags.h.

◆ operator^=() [2/3]

template<typename E>
Flags& pcl::Flags< E >::operator^= ( enum_type  e)
inline

Performs a bitwise exclusive OR (XOR) operation with an enumerated flag value e and stores the resulting flags in this object. Returns a reference to this object.

Definition at line 223 of file Flags.h.

◆ operator^=() [3/3]

template<typename E>
Flags& pcl::Flags< E >::operator^= ( unsigned  m)
inline

Performs a bitwise exclusive OR (XOR) operation with a mask value m and stores the resulting flags in this object. Returns a reference to this object.

Definition at line 234 of file Flags.h.

◆ operator|() [1/3]

template<typename E>
constexpr Flags pcl::Flags< E >::operator| ( Flags< E >  f) const
inline

Bitwise OR between two Flags objects.

Definition at line 338 of file Flags.h.

◆ operator|() [2/3]

template<typename E>
constexpr Flags pcl::Flags< E >::operator| ( enum_type  e) const
inline

Bitwise OR between a Flags object and an enumerated value.

Definition at line 346 of file Flags.h.

◆ operator|() [3/3]

template<typename E>
constexpr Flags pcl::Flags< E >::operator| ( unsigned  m) const
inline

Bitwise OR between a Flags object and a mask.

Definition at line 354 of file Flags.h.

◆ operator|=() [1/3]

template<typename E>
Flags& pcl::Flags< E >::operator|= ( Flags< E >  f)
inline

Performs a bitwise inclusive OR operation with other flags f and stores the resulting flags in this object. Returns a reference to this object.

Definition at line 179 of file Flags.h.

◆ operator|=() [2/3]

template<typename E>
Flags& pcl::Flags< E >::operator|= ( enum_type  e)
inline

Performs a bitwise inclusive OR operation with an enumerated flag value e and stores the resulting flags in this object. Returns a reference to this object.

Definition at line 190 of file Flags.h.

◆ operator|=() [3/3]

template<typename E>
Flags& pcl::Flags< E >::operator|= ( unsigned  m)
inline

Performs a bitwise inclusive OR operation with a mask value m and stores the resulting flags in this object. Returns a reference to this object.

Definition at line 201 of file Flags.h.

◆ operator~()

template<typename E>
constexpr Flags pcl::Flags< E >::operator~ ( ) const
inline

Returns a Flags object whose value is the bitwise negation of the flags stored in this object.

Definition at line 306 of file Flags.h.

◆ SetFlag()

template<typename E>
void pcl::Flags< E >::SetFlag ( enum_type  e,
bool  on = true 
)
inline

Sets or clears the specified flag e in this Flags object.

Definition at line 251 of file Flags.h.


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