Revision 24c62e97 host/include/uhd/types/io_type.hpp

b/host/include/uhd/types/io_type.hpp
1
//
2
// Copyright 2010-2011 Ettus Research LLC
3
//
4
// This program is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
//
17

  
18
#ifndef INCLUDED_UHD_TYPES_IO_TYPE_HPP
19
#define INCLUDED_UHD_TYPES_IO_TYPE_HPP
20

  
21
#include <uhd/config.hpp>
22

  
23
namespace uhd{
24

  
25
    /*!
26
     * The Input/Output configuration struct:
27
     * Used to specify the IO type with device send/recv.
28
     */
29
    class UHD_API io_type_t{
30
    public:
31

  
32
        /*!
33
         * Built in IO types known to the system.
34
         */
35
        enum tid_t{
36
            //! Custom type (technically unsupported by implementation)
37
            CUSTOM_TYPE =     int('?'),
38
            //! Complex floating point (64-bit floats) range [-1.0, +1.0]
39
            COMPLEX_FLOAT64 = int('d'),
40
            //! Complex floating point (32-bit floats) range [-1.0, +1.0]
41
            COMPLEX_FLOAT32 = int('f'),
42
            //! Complex signed integer (16-bit integers) range [-32768, +32767]
43
            COMPLEX_INT16 =   int('s'),
44
            //! Complex signed integer (8-bit integers) range [-128, 127]
45
            COMPLEX_INT8 =    int('b')
46
        };
47

  
48
        /*!
49
         * The size of this io type in bytes.
50
         */
51
        const size_t size;
52

  
53
        /*!
54
         * The type id of this io type.
55
         * Good for using with switch statements.
56
         */
57
        const tid_t tid;
58

  
59
        /*!
60
         * Create an io type from a built-in type id.
61
         * \param tid a type id known to the system
62
         */
63
        io_type_t(tid_t tid);
64

  
65
        /*!
66
         * Create an io type from attributes.
67
         * The tid will be set to custom.
68
         * \param size the size in bytes
69
         */
70
        io_type_t(size_t size);
71

  
72
    };
73

  
74
} //namespace uhd
75

  
76
#endif /* INCLUDED_UHD_TYPES_IO_TYPE_HPP */
1
//The IO type API has been deprecated in favor of the streamer interface
2
#include <uhd/deprecated.hpp>

Also available in: Unified diff