Browse Source

Trade: doc++

pull/565/merge
Vladimír Vondruš 4 years ago
parent
commit
16703f3137
  1. 40
      src/Magnum/Trade/MaterialData.h

40
src/Magnum/Trade/MaterialData.h

@ -1184,8 +1184,8 @@ enum class MaterialAttributeType: UnsignedByte {
/** /**
* Null-terminated string. Can be stored using any type convertible to * Null-terminated string. Can be stored using any type convertible to
* @ref Corrade::Containers::StringView, retrieval has to be done using * @relativeref{Corrade,Containers::StringView}, retrieval has to be done
* @ref Corrade::Containers::StringView. * using @relativeref{Corrade,Containers::StringView}.
*/ */
String, String,
@ -1355,7 +1355,7 @@ class MAGNUM_TRADE_EXPORT MaterialAttributeData {
* @brief Attribute name * @brief Attribute name
* *
* The returned view always has * The returned view always has
* @ref Corrade::Containers::StringViewFlag::NullTerminated set. * @relativeref{Corrade,Containers::StringViewFlag::NullTerminated} set.
*/ */
Containers::StringView name() const { return _data.data + 1; } Containers::StringView name() const { return _data.data + 1; }
@ -1697,7 +1697,7 @@ existing attributes.
@section Trade-MaterialData-populating Populating an instance @section Trade-MaterialData-populating Populating an instance
A @ref MaterialData instance by default takes over ownership of an A @ref MaterialData instance by default takes over ownership of an
@ref Corrade::Containers::Array containing @ref MaterialAttributeData @relativeref{Corrade,Containers::Array} containing @ref MaterialAttributeData
instances, together with @ref MaterialTypes suggesting available material types instances, together with @ref MaterialTypes suggesting available material types
(or an empty set, in case of a fully custom material). Attribute values can be (or an empty set, in case of a fully custom material). Attribute values can be
in one of the types from @ref MaterialAttributeType, and the type is in most in one of the types from @ref MaterialAttributeType, and the type is in most
@ -1727,8 +1727,8 @@ already sorted by name.
@par @par
Additionally, as shown above, in order to create a @cpp constexpr @ce Additionally, as shown above, in order to create a @cpp constexpr @ce
@ref MaterialAttributeData array, you need to use @ref MaterialAttributeData array, you need to use
@ref Corrade::Containers::StringView literals instead of plain C strings @relativeref{Corrade,Containers::StringView} literals instead of plain C
or the @ref MaterialAttribute enum, and be sure to call only strings or the @ref MaterialAttribute enum, and be sure to call only
@cpp constexpr @ce-enabled constructors of stored data types. @cpp constexpr @ce-enabled constructors of stored data types.
@subsection Trade-MaterialData-populating-custom Custom material attributes @subsection Trade-MaterialData-populating-custom Custom material attributes
@ -2371,7 +2371,7 @@ class MAGNUM_TRADE_EXPORT MaterialData {
* The @p layer is expected to be smaller than @ref layerCount() const * The @p layer is expected to be smaller than @ref layerCount() const
* and the @p id is expected to be smaller than @ref attributeCount(UnsignedInt) const * and the @p id is expected to be smaller than @ref attributeCount(UnsignedInt) const
* in that layer. The returned view always has * in that layer. The returned view always has
* @ref Corrade::Containers::StringViewFlag::NullTerminated set. * @relativeref{Corrade,Containers::StringViewFlag::NullTerminated} set.
* @see @ref attributeType() * @see @ref attributeType()
*/ */
Containers::StringView attributeName(UnsignedInt layer, UnsignedInt id) const; Containers::StringView attributeName(UnsignedInt layer, UnsignedInt id) const;
@ -2643,7 +2643,7 @@ class MAGNUM_TRADE_EXPORT MaterialData {
* @ref attributeCount(UnsignedInt) const in that layer. Expects that * @ref attributeCount(UnsignedInt) const in that layer. Expects that
* @p T corresponds to @ref attributeType(UnsignedInt, UnsignedInt) const * @p T corresponds to @ref attributeType(UnsignedInt, UnsignedInt) const
* for given @p layer and @p id. In case of a string, the returned view * for given @p layer and @p id. In case of a string, the returned view
* always has @ref Corrade::Containers::StringViewFlag::NullTerminated * always has @relativeref{Corrade,Containers::StringViewFlag::NullTerminated}
* set. * set.
*/ */
template<class T> T attribute(UnsignedInt layer, UnsignedInt id) const; template<class T> T attribute(UnsignedInt layer, UnsignedInt id) const;
@ -2669,8 +2669,8 @@ class MAGNUM_TRADE_EXPORT MaterialData {
* and @p name is expected to exist in that layer. Expects that @p T * and @p name is expected to exist in that layer. Expects that @p T
* corresponds to @ref attributeType(UnsignedInt, Containers::StringView) const * corresponds to @ref attributeType(UnsignedInt, Containers::StringView) const
* for given @p layer and @p name. In case of a string, the returned * for given @p layer and @p name. In case of a string, the returned
* view always has * view always has @relativeref{Corrade,Containers::StringViewFlag::NullTerminated}
* @ref Corrade::Containers::StringViewFlag::NullTerminated set. * set.
* @see @ref hasLayer(), @ref hasAttribute() * @see @ref hasLayer(), @ref hasAttribute()
*/ */
template<class T> T attribute(UnsignedInt layer, Containers::StringView name) const; template<class T> T attribute(UnsignedInt layer, Containers::StringView name) const;
@ -2699,7 +2699,7 @@ class MAGNUM_TRADE_EXPORT MaterialData {
* Expects that @p T corresponds to * Expects that @p T corresponds to
* @ref attributeType(Containers::StringView, UnsignedInt) const * @ref attributeType(Containers::StringView, UnsignedInt) const
* for given @p layer and @p id. In case of a string, the returned view * for given @p layer and @p id. In case of a string, the returned view
* always has @ref Corrade::Containers::StringViewFlag::NullTerminated * always has @relativeref{Corrade,Containers::StringViewFlag::NullTerminated}
* set. * set.
* @see @ref hasLayer() * @see @ref hasLayer()
*/ */
@ -2728,8 +2728,8 @@ class MAGNUM_TRADE_EXPORT MaterialData {
* in that layer. Expects that @p T corresponds to * in that layer. Expects that @p T corresponds to
* @ref attributeType(Containers::StringView, Containers::StringView) const * @ref attributeType(Containers::StringView, Containers::StringView) const
* for given @p layer and @p name. In case of a string, the returned * for given @p layer and @p name. In case of a string, the returned
* view always has * view always has @relativeref{Corrade,Containers::StringViewFlag::NullTerminated}
* @ref Corrade::Containers::StringViewFlag::NullTerminated set. * set.
* @see @ref hasLayer(), @ref hasAttribute() * @see @ref hasLayer(), @ref hasAttribute()
*/ */
template<class T> T attribute(Containers::StringView layer, Containers::StringView name) const; template<class T> T attribute(Containers::StringView layer, Containers::StringView name) const;
@ -2830,9 +2830,10 @@ class MAGNUM_TRADE_EXPORT MaterialData {
* @brief Value of a named attribute in given material layer, if exists * @brief Value of a named attribute in given material layer, if exists
* *
* Compared to @ref attribute(UnsignedInt, Containers::StringView name) const, * Compared to @ref attribute(UnsignedInt, Containers::StringView name) const,
* if @p name doesn't exist, returns @ref Corrade::Containers::NullOpt * if @p name doesn't exist, returns
* instead of asserting. Expects that @p layer is smaller than * @relativeref{Corrade,Containers::NullOpt} instead of asserting.
* @ref layerCount() const and that @p T corresponds to * Expects that @p layer is smaller than @ref layerCount() const and
* that @p T corresponds to
* @ref attributeType(UnsignedInt, Containers::StringView) const for * @ref attributeType(UnsignedInt, Containers::StringView) const for
* given @p layer and @p name. * given @p layer and @p name.
*/ */
@ -2843,9 +2844,10 @@ class MAGNUM_TRADE_EXPORT MaterialData {
* @brief Value of a named attribute in a named material layer, if exists * @brief Value of a named attribute in a named material layer, if exists
* *
* Compared to @ref attribute(Containers::StringView, Containers::StringView name) const, * Compared to @ref attribute(Containers::StringView, Containers::StringView name) const,
* if @p name doesn't exist, returns @ref Corrade::Containers::NullOpt * if @p name doesn't exist, returns
* instead of asserting. Expects that @p layer exists and that @p T * @relativeref{Corrade,Containers::NullOpt} instead of asserting.
* corresponds to @ref attributeType(Containers::StringView, Containers::StringView) const * Expects that @p layer exists and that @p T corresponds to
* @ref attributeType(Containers::StringView, Containers::StringView) const
* for given @p layer and @p name. * for given @p layer and @p name.
* @see @ref hasLayer() * @see @ref hasLayer()
*/ */

Loading…
Cancel
Save