Rpi-hw  0.7.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
base-inl.hpp
1 /*
2  Title --- iface/base-inl.hpp
3 
4  Copyright (C) 2013 Giacomo Trudu - wicker25[at]gmail[dot]com
5 
6  This file is part of Rpi-hw.
7 
8  Rpi-hw is free software: you can redistribute it and/or modify
9  it under the terms of the GNU Lesser General Public License as published by
10  the Free Software Foundation version 3 of the License.
11 
12  Rpi-hw is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with Rpi-hw. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 
22 #ifndef _RPI_HW_IFACE_BASE_INL_HPP_
23 #define _RPI_HW_IFACE_BASE_INL_HPP_
24 
25 namespace rpihw { // Begin main namespace
26 
27 namespace iface { // Begin interfaces namespace
28 
29 inline uint8_t
30 base::getPin( uint8_t index ) const {
31 
32  // Return the interface pin
33  return m_pins[ index ];
34 }
35 
36 inline uint8_t
37 base::size() const {
38 
39  // Return the number of pins
40  return (uint8_t) m_pins.size();
41 }
42 
43 } // End of interfaces namespace
44 
45 } // End of main namespace
46 
47 #endif /* _RPI_HW_IFACE_BASE_INL_HPP_ */
virtual uint8_t size() const
Returns the number of the pins.
Definition: base-inl.hpp:37
std::vector< uint8_t > m_pins
Vector containing interface pins.
Definition: base.hpp:87
virtual uint8_t getPin(uint8_t index) const
Returns an interface pin.
Definition: base-inl.hpp:30