C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2
VSN::Flags< Enum > Class Template Reference

Flags<Enum> is a template class where Enum is an enumarated type. Flags is used to store enumeration value combinations in C3D Vision. More...

#include <vsn_flags.h>

Public Types

typedef Enum enum_type
 Typedef for Enum template type. Copy constructor of Flags object.
 

Public Member Functions

 Flags (Enum f)
 Flags object constructor with flag parameter for storing data.
 
 Flags (Zero=0)
 Flags object constructor with no defined flags.
 
 Flags (Flag f)
 Flags object constructor initialized by integer value.
 
 Flags (int f)
 Flags object constructor initialized by integer value.
 
Flagsoperator= (const Flags &f)
 Copies all flags to object and returns reference to that object.
 
Flagsoperator&= (int mask)
 Performs bitwise AND-operation with mask and saves result in Flags object. Returns reference to the object.
 
Flagsoperator&= (uint mask)
 Оverloaded function.
 
Flagsoperator|= (Flags f)
 Performs bitwise OR-operation with another object and saves result in Flags object. Returns reference to the object.
 
Flagsoperator|= (Enum f)
 Оverloaded function.
 
Flagsoperator|= (int f)
 Оverloaded function.
 
Flagsoperator^= (Flags f)
 Performs bitwise XOR-operation with another Flags object and saves result in Flags object. Returns reference to the object.
 
Flagsoperator^= (Enum f)
 Оverloaded function.
 
 operator int () const
 Returns integer value saved in Flags object.
 
Flags operator| (Flags f) const
 Returns Flags object containing result of bitwise OR-operation on the object.
 
Flags operator| (Enum f) const
 Оverloaded function.
 
Flags operator^ (Flags f) const
 Returns Flags object containing result of bitwise XOR-operation on the object.
 
Flags operator^ (Enum f) const
 Оverloaded function.
 
Flags operator& (int mask) const
 Returns Flags object containing result of AND-operation performed.
 
Flags operator& (uint mask) const
 Оverloaded function.
 
Flags operator& (Enum f) const
 Оverloaded function.
 
Flags operator~ () const
 Returns Flags object containing bitwise complement of the object.
 
bool operator! () const
 True if flag is set, i.e. if value stored in Flags object is 0, otherwise, False.
 
bool CheckFlag (Enum f) const
 True if flag is set.
 

Detailed Description

template<typename Enum>
class VSN::Flags< Enum >

Flags<Enum> is a template class where Enum is an enumarated type. Flags is used to store enumeration value combinations in C3D Vision.

С++ conventional approach for storing Enum value OR-combinations defines using int or uint variables. The inconvenience of that approach is an absence of type checking. Any value of enumeration can be OR-operation with another value of enumeration and it can be passed in function taking int or uint variables.


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