82#define PIMP_DECLARE_PRIVATE(Class)
98#define PIMP_DECLARE_PUBLIC(Class)
102#define BIT(n) (1UL << (n))
106#define EXCEPTION_MSG(m) std::string{} + __FILE_NAME__ + "(" + std::to_string(__LINE__) + "): [" + __func__ +"] " + m
108#define EXCEPTION_MSG(m) std::string{} + __FILE__ + "(" + std::to_string(__LINE__) + "): [" + __func__ +"] " + m
112 static inline void Assert (
const char *expr_str,
bool expr,
const char *file,
int line,
const std::string msg) {
114 std::cerr << std::endl
115 <<
"---------->>>" << std::endl
116 <<
"Assert failed:\t" << msg << std::endl
117 <<
"Expected:\t" << expr_str << std::endl
118 <<
"Source:\t\t" << file <<
":" << line << std::endl
119 <<
"----------<<<" << std::endl;
126# define M_Assert(Expr, Msg) \
127 Piduino::Assert(#Expr, Expr, __FILE__, __LINE__, Msg)
129# define M_Assert(Expr, Msg) ;
134#define PIMP_D(Class) Class::Private * const d = d_func()
135#define PIMP_Q(Class) Class * const q = q_func()
136#define PIMP_DECLARE_PRIVATE(Class)\
137 inline Class::Private* d_func() {\
138 return reinterpret_cast<Class::Private*>(d_ptr.get());\
140 inline const Class::Private* d_func() const {\
141 return reinterpret_cast<const Class::Private *>(d_ptr.get());\
143 friend class Class::Private;
144#define PIMP_DECLARE_PUBLIC(Class) \
145 inline Class* q_func() { return reinterpret_cast<Class *>(q_ptr); } \
146 inline const Class* q_func() const { return reinterpret_cast<const Class *>(q_ptr); } \
Global namespace for Piduino.