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

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

#include <src/types.h>

Public Member Functions

constexpr TypeSpecifier () noexcept
std::string to_string () const

Friends

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

Constructor & Destructor Documentation

◆ TypeSpecifier()

TypeSpecifier::TypeSpecifier ( )
inlineconstexprnoexcept

Definition at line 696 of file types.h.

696 :
697#define TSPEC(x) ,m_is##x(0)
698#define TSPEC0(x) m_is##x(0)
700#undef TSPEC0
701#undef TSPEC
702 {}
703
704 constexpr void reset() noexcept
705 {
706#define TSPEC(x) m_is##x = 0;
707#define TSPEC0(x) TSPEC(x)
709#undef TSPEC0
710#undef TSPEC
711 }
712
713 constexpr void merge(const TypeSpecifier &other) noexcept
714 {
715#define TSPEC(x) m_is##x = m_is##x || other.is##x();
716#define TSPEC0(x) TSPEC(x)
718#undef TSPEC0
719#undef TSPEC
720 }
721
722 friend inline bool operator==(const TypeSpecifier &t1,const TypeSpecifier &t2)
723 {
724 bool eq = true;
725#define TSPEC(x) eq = eq && (t1.m_is##x == t2.m_is##x);
726#define TSPEC0(x) TSPEC(x)
728#undef TSPEC0
729#undef TSPEC
730 return eq;
731 }
constexpr TypeSpecifier() noexcept
Definition types.h:696
bool operator==(const DirIterator &it1, const DirIterator &it2)
Definition dir.cpp:160
#define TYPE_SPECIFIERS
Definition types.h:673

References TYPE_SPECIFIERS.

Referenced by operator!=.

Member Function Documentation

◆ to_string()

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

Definition at line 738 of file types.h.

739 {
740 std::string result="[";
741 bool first=true;
742#define TSPEC(x) \
743 if (m_is##x) { \
744 if (!first) result+=","; \
745 result+=#x; first=false; \
746 }
747#define TSPEC0(x) TSPEC(x)
749#undef TSPEC0
750#undef TSPEC
751 result+="]";
752 return result;
753 }

References TYPE_SPECIFIERS.

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

◆ operator!=

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

Definition at line 733 of file types.h.

734 {
735 return !(operator==(t1,t2));
736 }

References operator==(), and TypeSpecifier().


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