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 491 of file types.h.

Constructor & Destructor Documentation

◆ TypeSpecifier()

TypeSpecifier::TypeSpecifier ( )
inline

Definition at line 494 of file types.h.

494{ reset(); }
void reset()
Definition types.h:496

References reset().

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

Member Function Documentation

◆ merge()

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

Definition at line 498 of file types.h.

499 {
500#define TSPEC(x) m_is##x = m_is##x || other.is##x();
502#undef TSPEC
503 }
#define TYPE_SPECIFIERS
Definition types.h:472

References TYPE_SPECIFIERS, and TypeSpecifier().

◆ reset()

void TypeSpecifier::reset ( )
inline

Definition at line 496 of file types.h.

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

Referenced by TypeSpecifier().

◆ to_string()

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

Definition at line 520 of file types.h.

521 {
522 std::string result="[";
523 bool first=true;
524#define TSPEC(x) \
525 if (m_is##x) { \
526 if (!first) result+=","; \
527 result+=#x; first=false; \
528 }
530#undef TSPEC
531 result+="]";
532 return result;
533 }

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 514 of file types.h.

515 {
516 return !(operator==(t1,t2));
517 }
friend bool operator==(const TypeSpecifier &t1, const TypeSpecifier &t2)
Definition types.h:505

References operator==, and TypeSpecifier().

◆ operator==

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

Definition at line 505 of file types.h.

506 {
507 bool eq = true;
508#define TSPEC(x) eq = eq && (t1.m_is##x == t2.m_is##x);
510#undef TSPEC
511 return eq;
512 }

References TYPE_SPECIFIERS, and TypeSpecifier().

Referenced by operator!=.


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