shark::TypedFlags< Flag > Class Template Reference

Flexible and extensible mechanisms for holding flags. More...

#include <shark/Core/Flags.h>

+ Inheritance diagram for shark::TypedFlags< Flag >:

Public Member Functions

 TypedFlags ()
 
 TypedFlags (TypedFlags const &other)
 
virtual ~TypedFlags ()
 
TypedFlags< Flag > & operator= (TypedFlags< Flag > const &rhs)
 
void set (Flag f)
 
void setAll ()
 
void reset ()
 
void reset (Flag f)
 
bool test (Flag f) const
 
bool operator & (Flag f) const
 
TypedFlags< Flag > & operator|= (Flag f)
 
TypedFlags< Flag > & operator|= (const TypedFlags< Flag > &flags)
 
TypedFlags< Flag > operator| (Flag f) const
 
TypedFlags< Flag > operator| (const TypedFlags< Flag > &flags) const
 
virtual void read (InArchive &archive)
 Read the component from the supplied archive. More...
 
virtual void write (OutArchive &archive) const
 Write the component to the supplied archive. More...
 
- Public Member Functions inherited from shark::ISerializable
virtual ~ISerializable ()
 Virtual d'tor. More...
 
void load (InArchive &archive, unsigned int version)
 Versioned loading of components, calls read(...). More...
 
void save (OutArchive &archive, unsigned int version) const
 Versioned storing of components, calls write(...). More...
 
 BOOST_SERIALIZATION_SPLIT_MEMBER ()
 

Protected Attributes

unsigned int m_flags
 

Detailed Description

template<typename Flag>
class shark::TypedFlags< Flag >

Flexible and extensible mechanisms for holding flags.

The world's most airbrushed integer ever...
This class encapsulates a flexible mechanism for holding flags. Its templatization makes it possible to base it on any base type, while unsigned int will be the most common choice. This mechanism makes it possible, in principle, to support as many flags as needed. Furthermore, classes may extend the flags defined by their superclass.

Definition at line 58 of file Flags.h.

Constructor & Destructor Documentation

◆ TypedFlags() [1/2]

template<typename Flag>
shark::TypedFlags< Flag >::TypedFlags ( )
inline

Definition at line 60 of file Flags.h.

◆ TypedFlags() [2/2]

template<typename Flag>
shark::TypedFlags< Flag >::TypedFlags ( TypedFlags< Flag > const &  other)
inline

Definition at line 61 of file Flags.h.

◆ ~TypedFlags()

template<typename Flag>
virtual shark::TypedFlags< Flag >::~TypedFlags ( )
inlinevirtual

Definition at line 63 of file Flags.h.

Member Function Documentation

◆ operator &()

template<typename Flag>
bool shark::TypedFlags< Flag >::operator& ( Flag  f) const
inline

Definition at line 90 of file Flags.h.

◆ operator=()

template<typename Flag>
TypedFlags<Flag>& shark::TypedFlags< Flag >::operator= ( TypedFlags< Flag > const &  rhs)
inline

Definition at line 65 of file Flags.h.

◆ operator|() [1/2]

template<typename Flag>
TypedFlags<Flag> shark::TypedFlags< Flag >::operator| ( Flag  f) const
inline

Definition at line 104 of file Flags.h.

◆ operator|() [2/2]

template<typename Flag>
TypedFlags<Flag> shark::TypedFlags< Flag >::operator| ( const TypedFlags< Flag > &  flags) const
inline

Definition at line 109 of file Flags.h.

◆ operator|=() [1/2]

template<typename Flag>
TypedFlags<Flag>& shark::TypedFlags< Flag >::operator|= ( Flag  f)
inline

Definition at line 94 of file Flags.h.

◆ operator|=() [2/2]

template<typename Flag>
TypedFlags<Flag>& shark::TypedFlags< Flag >::operator|= ( const TypedFlags< Flag > &  flags)
inline

Definition at line 99 of file Flags.h.

◆ read()

template<typename Flag>
virtual void shark::TypedFlags< Flag >::read ( InArchive archive)
inlinevirtual

Read the component from the supplied archive.

Parameters
[in,out]archiveThe archive to read from.

Reimplemented from shark::ISerializable.

Definition at line 115 of file Flags.h.

Referenced by shark::AbstractModel< InputT, unsigned int >::read().

◆ reset() [1/2]

◆ reset() [2/2]

template<typename Flag>
void shark::TypedFlags< Flag >::reset ( Flag  f)
inline

Definition at line 82 of file Flags.h.

◆ set()

template<typename Flag>
void shark::TypedFlags< Flag >::set ( Flag  f)
inline

◆ setAll()

template<typename Flag>
void shark::TypedFlags< Flag >::setAll ( )
inline

Definition at line 74 of file Flags.h.

◆ test()

template<typename Flag>
bool shark::TypedFlags< Flag >::test ( Flag  f) const
inline

◆ write()

template<typename Flag>
virtual void shark::TypedFlags< Flag >::write ( OutArchive archive) const
inlinevirtual

Write the component to the supplied archive.

Parameters
[in,out]archiveThe archive to write to.

Reimplemented from shark::ISerializable.

Definition at line 118 of file Flags.h.

Referenced by shark::AbstractModel< InputT, unsigned int >::write().

Member Data Documentation

◆ m_flags


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