ManaPlus
Public Member Functions | Data Fields
mse::CBool Class Reference

#include <mseprimitives.h>

Public Member Functions

 CBool ()
 
 CBool (const CBool &x)
 
CBooloperator= (const CBool &x)
 
 CBool (bool x)
 
 operator bool () const
 
CBooloperator|= (const CBool &x)
 
CBooloperator&= (const CBool &x)
 
CBooloperator^= (const CBool &x)
 
void note_value_assignment ()
 
void assert_initialized () const
 

Data Fields

bool m_val
 
bool m_initialized = false
 

Detailed Description

Definition at line 94 of file mseprimitives.h.

Constructor & Destructor Documentation

◆ CBool() [1/3]

mse::CBool::CBool ( )
inline

Definition at line 97 of file mseprimitives.h.

97 : m_val(false) {}

◆ CBool() [2/3]

mse::CBool::CBool ( const CBool x)
inline

Definition at line 100 of file mseprimitives.h.

100 : m_val(x.m_val) { note_value_assignment(); };
void note_value_assignment()

References note_value_assignment().

◆ CBool() [3/3]

mse::CBool::CBool ( bool  x)
inline

Definition at line 106 of file mseprimitives.h.

106 { note_value_assignment(); m_val = x; }

References m_val, note_value_assignment(), and x.

Member Function Documentation

◆ assert_initialized()

void mse::CBool::assert_initialized ( ) const
inline

Definition at line 119 of file mseprimitives.h.

119 { assert(m_initialized); }
bool m_initialized

References m_initialized.

Referenced by operator bool(), operator&=(), operator^=(), and operator|=().

◆ note_value_assignment()

void mse::CBool::note_value_assignment ( )
inline

Definition at line 118 of file mseprimitives.h.

118 { m_initialized = true; }

References m_initialized.

Referenced by CBool(), and operator=().

◆ operator bool()

mse::CBool::operator bool ( ) const
inline

Definition at line 109 of file mseprimitives.h.

109 { assert_initialized(); return m_val; }
void assert_initialized() const

References assert_initialized(), and m_val.

◆ operator&=()

CBool& mse::CBool::operator&= ( const CBool x)
inline

Definition at line 112 of file mseprimitives.h.

112 { assert_initialized(); m_val &= x.m_val; return (*this); }

References assert_initialized(), m_val, and x.

◆ operator=()

CBool& mse::CBool::operator= ( const CBool x)
inline

Definition at line 103 of file mseprimitives.h.

103 { note_value_assignment(); m_val = x.m_val; return (*this); }

References m_val, note_value_assignment(), and x.

◆ operator^=()

CBool& mse::CBool::operator^= ( const CBool x)
inline

Definition at line 113 of file mseprimitives.h.

113 { assert_initialized(); m_val ^= x.m_val; return (*this); }

References assert_initialized(), m_val, and x.

◆ operator|=()

CBool& mse::CBool::operator|= ( const CBool x)
inline

Definition at line 111 of file mseprimitives.h.

111 { assert_initialized(); m_val |= x.m_val; return (*this); }

References assert_initialized(), m_val, and x.

Field Documentation

◆ m_initialized

bool mse::CBool::m_initialized = false

Definition at line 120 of file mseprimitives.h.

Referenced by assert_initialized(), and note_value_assignment().

◆ m_val

bool mse::CBool::m_val

Definition at line 115 of file mseprimitives.h.

Referenced by CBool(), operator bool(), operator&=(), operator=(), operator^=(), and operator|=().


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