Doxygen
Loading...
Searching...
No Matches
TypeSpecifier Class Reference

Wrapper class for a number of boolean properties. More...

#include <src/types.h>

Public Member Functions

 TypeSpecifier ()
 
void reset ()
 
void merge (const TypeSpecifier &other)
 
std::string to_string () const
 

Friends

bool operator== (const TypeSpecifier &t1, const TypeSpecifier &t2)
 
bool operator!= (const TypeSpecifier &t1, const TypeSpecifier &t2)
 

Detailed Description

Wrapper class for a number of boolean properties.

The properties are packed together, and initialized to false.

Definition at line 653 of file types.h.

Constructor & Destructor Documentation

◆ TypeSpecifier()

TypeSpecifier::TypeSpecifier ( )
inline

Definition at line 656 of file types.h.

656{ reset(); }
void reset()
Definition types.h:658

References reset().

Referenced by merge(), operator!=, and operator==.

Member Function Documentation

◆ merge()

void TypeSpecifier::merge ( const TypeSpecifier & other)
inline

Definition at line 660 of file types.h.

661 {
662#define TSPEC(x) m_is##x = m_is##x || other.is##x();
664#undef TSPEC
665 }
#define TYPE_SPECIFIERS
Definition types.h:634

References TYPE_SPECIFIERS, and TypeSpecifier().

◆ reset()

void TypeSpecifier::reset ( )
inline

Definition at line 658 of file types.h.

658{ std::memset(this, 0, sizeof(*this)); }

Referenced by TypeSpecifier().

◆ to_string()

std::string TypeSpecifier::to_string ( ) const
inline

Definition at line 682 of file types.h.

683 {
684 std::string result="[";
685 bool first=true;
686#define TSPEC(x) \
687 if (m_is##x) { \
688 if (!first) result+=","; \
689 result+=#x; first=false; \
690 }
692#undef TSPEC
693 result+="]";
694 return result;
695 }

References TYPE_SPECIFIERS.

Referenced by fmt::formatter< TypeSpecifier >::format(), and printNavTree().

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const TypeSpecifier & t1,
const TypeSpecifier & t2 )
friend

Definition at line 676 of file types.h.

677 {
678 return !(operator==(t1,t2));
679 }
friend bool operator==(const TypeSpecifier &t1, const TypeSpecifier &t2)
Definition types.h:667

References operator==, and TypeSpecifier().

◆ operator==

bool operator== ( const TypeSpecifier & t1,
const TypeSpecifier & t2 )
friend

Definition at line 667 of file types.h.

668 {
669 bool eq = true;
670#define TSPEC(x) eq = eq && (t1.m_is##x == t2.m_is##x);
672#undef TSPEC
673 return eq;
674 }

References TYPE_SPECIFIERS, and TypeSpecifier().

Referenced by operator!=.


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