diff options
author | Max Kellermann <max@duempel.org> | 2013-12-01 19:30:52 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-12-01 19:32:00 +0100 |
commit | 7661ad6653eb69b1237dc815f1d032afd644e9c3 (patch) | |
tree | 8d40bd6ec6e6e4b20abc3d3b542340d3e00c712f /src | |
parent | e1436063ffb236ac22d69531782f7056b8b5ae30 (diff) | |
download | mpd-7661ad6653eb69b1237dc815f1d032afd644e9c3.tar.gz mpd-7661ad6653eb69b1237dc815f1d032afd644e9c3.tar.xz mpd-7661ad6653eb69b1237dc815f1d032afd644e9c3.zip |
pcm/Traits: add API documentation
Diffstat (limited to 'src')
-rw-r--r-- | src/pcm/Traits.hxx | 24 |
1 files changed, 24 insertions, 0 deletions
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 <stdint.h> +/** + * This template describes the specified #SampleFormat. This is an + * empty prototype; the specializations contain the real definitions. + * See SampleTraits<uint8_t> for more documentation. + */ template<SampleFormat F> struct SampleTraits {}; template<> struct SampleTraits<SampleFormat::S8> { + /** + * 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; }; |