From 7661ad6653eb69b1237dc815f1d032afd644e9c3 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 1 Dec 2013 19:30:52 +0100 Subject: [PATCH] pcm/Traits: add API documentation --- src/pcm/Traits.hxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/pcm/Traits.hxx b/src/pcm/Traits.hxx index 17bcfee85..b102b41ab 100644 --- a/src/pcm/Traits.hxx +++ b/src/pcm/Traits.hxx @@ -25,16 +25,40 @@ #include +/** + * This template describes the specified #SampleFormat. This is an + * empty prototype; the specializations contain the real definitions. + * See SampleTraits for more documentation. + */ template struct SampleTraits {}; template<> struct SampleTraits { + /** + * The type used for one sample value. + */ typedef int8_t value_type; + + /** + * A writable pointer. + */ typedef value_type *pointer_type; + + /** + * A read-only pointer. + */ typedef const value_type *const_pointer_type; + /** + * The size of one sample in bytes. + */ static constexpr size_t SAMPLE_SIZE = sizeof(value_type); + + /** + * The integer bit depth of one sample. This attribute may + * not exist if this is not an integer sample format. + */ static constexpr unsigned BITS = sizeof(value_type) * 8; };