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

using enum_type = E
 
using flag_type = typename FlagType< std::is_unsigned< enum_type >::value >::type
 

Public Member Functions

 Flags ()=default
 
 Flags (const Flags &)=default
 
constexpr Flags (enum_type e)
 
constexpr Flags (flag_type m)
 
constexpr flag_type AsInteger () const
 
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& (enum_type e) const
 
constexpr Flags operator& (Flags f) const
 
constexpr Flags operator& (unsigned m) const
 
Flagsoperator&= (enum_type e)
 
Flagsoperator&= (Flags f)
 
Flagsoperator&= (unsigned m)
 
Flagsoperator<< (enum_type e)
 
Flagsoperator= (const Flags &)=default
 
Flagsoperator= (enum_type e)
 
constexpr Flags operator^ (enum_type e) const
 
constexpr Flags operator^ (Flags f) const
 
constexpr Flags operator^ (unsigned m) const
 
Flagsoperator^= (enum_type e)
 
Flagsoperator^= (Flags f)
 
Flagsoperator^= (unsigned m)
 
constexpr Flags operator| (enum_type e) const
 
constexpr Flags operator| (Flags f) const
 
constexpr Flags operator| (unsigned m) const
 
Flagsoperator|= (enum_type e)
 
Flagsoperator|= (Flags f)
 
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 >
using pcl::Flags< E >::enum_type = E

Represents the enumerated type that defines individual flags.

Definition at line 94 of file Flags.h.

◆ flag_type

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

Represents the integral type used to store flags.

Definition at line 99 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)
inlineconstexpr

Constructs a Flags instance from an enumerated flag value e.

Definition at line 110 of file Flags.h.

◆ Flags() [3/4]

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

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

◆ AsInteger()

template<typename E >
constexpr flag_type pcl::Flags< E >::AsInteger ( ) const
inlineconstexpr

Returns the internal representation of flags as an integer value. Equivalent to operator flag_type().

Definition at line 307 of file Flags.h.

◆ Clear()

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

Clears all flags in this object.

Definition at line 272 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 264 of file Flags.h.

◆ IsFlagSet()

◆ operator flag_type()

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

Converts this Flags object to an integer.

Definition at line 298 of file Flags.h.

◆ operator!()

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

Returns true iff all flags in this object are zero.

Definition at line 290 of file Flags.h.

◆ operator&() [1/3]

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

Bitwise AND between a Flags object and an enumerated value.

Definition at line 332 of file Flags.h.

◆ operator&() [2/3]

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

Bitwise AND between two Flags objects.

Definition at line 324 of file Flags.h.

◆ operator&() [3/3]

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

Bitwise AND between a Flags object and a mask.

Definition at line 340 of file Flags.h.

◆ operator&=() [1/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 159 of file Flags.h.

◆ operator&=() [2/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 148 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 169 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 281 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 138 of file Flags.h.

◆ operator^() [1/3]

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

Bitwise XOR between a Flags object and an enumerated value.

Definition at line 380 of file Flags.h.

◆ operator^() [2/3]

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

Bitwise XOR between two Flags objects.

Definition at line 372 of file Flags.h.

◆ operator^() [3/3]

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

Bitwise XOR between a Flags object and a mask.

Definition at line 388 of file Flags.h.

◆ operator^=() [1/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 224 of file Flags.h.

◆ operator^=() [2/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 213 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 235 of file Flags.h.

◆ operator|() [1/3]

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

Bitwise OR between a Flags object and an enumerated value.

Definition at line 356 of file Flags.h.

◆ operator|() [2/3]

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

Bitwise OR between two Flags objects.

Definition at line 348 of file Flags.h.

◆ operator|() [3/3]

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

Bitwise OR between a Flags object and a mask.

Definition at line 364 of file Flags.h.

◆ operator|=() [1/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 191 of file Flags.h.

◆ operator|=() [2/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 180 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 202 of file Flags.h.

◆ operator~()

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

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

Definition at line 316 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 252 of file Flags.h.

Referenced by pcl::XMLElement::AddChildNode().


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