BitfieldType(const BitfieldType &) = default;
operator Type () const { return Impl::operator Type(); }
+
Type operator=(const Type val) { return Impl::operator=(val); }
Type
operator=(BitfieldType<Base> const & other)
union { \
type __storage;
-//This closes off the class and union started by the above macro. It is
-//followed by a typedef which makes "name" refer to a BitfieldOperator
-//class inheriting from the class and union just defined, which completes
-//building up the type for the user.
+/**
+ * This closes off the class and union started by the above macro. It is
+ * followed by a typedef which makes "name" refer to a BitfieldOperator
+ * class inheriting from the class and union just defined, which completes
+ * building up the type for the user.
+ *
+ * @ingroup api_bitunion
+ */
#define EndBitUnion(name) \
}; \
}; \
union { \
fieldType<__VA_ARGS__> __storage;
-//This closes off the union created above and gives it a name. Unlike the top
-//level BitUnion, we're interested in creating an object instead of a type.
-//The operators are defined in the macro itself instead of a class for
-//technical reasons. If someone determines a way to move them to one, please
-//do so.
+/**
+ * This closes off the union created above and gives it a name. Unlike the top
+ * level BitUnion, we're interested in creating an object instead of a type.
+ * The operators are defined in the macro itself instead of a class for
+ * technical reasons. If someone determines a way to move them to one, please
+ * do so.
+ *
+ * @ingroup api_bitunion
+ */
#define EndSubBitUnion(name) \
}; \
inline operator __StorageType () const \
{ return __storage = _storage;} \
} name;
-//Regular bitfields
-//These define macros for read/write regular bitfield based subbitfields.
+/**
+ * Regular bitfields
+ * These define macros for read/write regular bitfield based subbitfields.
+ *
+ * @ingroup api_bitunion
+ */
#define SubBitUnion(name, first, last) \
__SubBitUnion(name, Bitfield, first, last)
-//Regular bitfields
-//These define macros for read/write regular bitfield based subbitfields.
+/**
+ * Regular bitfields
+ * These define macros for read/write regular bitfield based subbitfields.
+ *
+ * @ingroup api_bitunion
+ */
#define SignedSubBitUnion(name, first, last) \
__SubBitUnion(name, SignedBitfield, first, last)
-//Use this to define an arbitrary type overlayed with bitfields.
+/**
+ * Use this to define an arbitrary type overlayed with bitfields.
+ *
+ * @ingroup api_bitunion
+ */
#define BitUnion(type, name) __BitUnion(type, name)
-//Use this to define conveniently sized values overlayed with bitfields.
+/**
+ * Use this to define conveniently sized values overlayed with bitfields.
+ *
+ * @ingroup api_bitunion
+ */
#define BitUnion64(name) __BitUnion(uint64_t, name)
#define BitUnion32(name) __BitUnion(uint32_t, name)
#define BitUnion16(name) __BitUnion(uint16_t, name)
//Also, BitUnionBaseType can be used on a BitUnion type directly.
+/**
+ * @ingroup api_bitunion
+ */
template <typename T>
using BitUnionType = BitfieldBackend::BitUnionOperators<T>;
};
}
+/**
+ * @ingroup api_bitunion
+ */
template <typename T>
using BitUnionBaseType = typename BitfieldBackend::BitUnionBaseType<T>::Type;
}
}
-//A default << operator which casts a bitunion to its underlying type and
-//passes it to BitfieldBackend::bitfieldBackendPrinter.
+/**
+ * A default << operator which casts a bitunion to its underlying type and
+ * passes it to BitfieldBackend::bitfieldBackendPrinter.
+ *
+ * @ingroup api_bitunion
+ */
template <typename T>
std::ostream &
operator << (std::ostream &os, const BitUnionType<T> &bu)