テスト用のあれこれ共用フォルダ
Révision | e83d4ad191e1a91d0410d43f5b15c51c6a5f4e69 (tree) |
---|---|
l'heure | 2018-04-27 18:56:46 |
Auteur | takemasa <suikan@user...> |
Commiter | takemasa |
Added AbstractPeripheral to add the stub to the loggers.
Remeved unneccesary destructor from the abstract classes.
Added doxygen comment.
@@ -31,13 +31,6 @@ namespace murasaki { | ||
31 | 31 | class AbstractI2CMaster : murasaki::AbstractPeripheral |
32 | 32 | { |
33 | 33 | public: |
34 | - /** | |
35 | - * \brief Destructor. Declared to enforce the derived destructor is virtual. | |
36 | - */ | |
37 | - virtual ~AbstractI2CMaster() | |
38 | - { | |
39 | - } | |
40 | - ; | |
41 | 34 | |
42 | 35 | /** |
43 | 36 | * @brief Thread safe, blocking transmission over I2C. |
@@ -69,7 +69,7 @@ class AbstractLogger | ||
69 | 69 | virtual void DoPostMotem( void * debugger_fifo){while(true);} |
70 | 70 | protected: |
71 | 71 | /** |
72 | - * \brief This special method helps derived loggers can access the raw device, in case of the | |
72 | + * \brief This special method helps derived loggers. The loggers can access the raw device, in case of the | |
73 | 73 | * post motem processing. |
74 | 74 | */ |
75 | 75 | static void * GetPeripheralHandle(murasaki::AbstractPeripheral * peripheral); |
@@ -81,7 +81,8 @@ class AbstractLogger | ||
81 | 81 | } /* namespace murasaki */ |
82 | 82 | |
83 | 83 | inline void* murasaki::AbstractLogger::GetPeripheralHandle( |
84 | - murasaki::AbstractPeripheral* peripheral) { | |
84 | + murasaki::AbstractPeripheral* peripheral) | |
85 | +{ | |
85 | 86 | return(peripheral->GetPeripheralHandle()); |
86 | 87 | } |
87 | 88 |
@@ -0,0 +1,39 @@ | ||
1 | +/** | |
2 | + * @file AbstractPeripheral.hpp | |
3 | + * | |
4 | + * @date 2018/04/26 | |
5 | + * @author: takemasa | |
6 | + * @brief Mother of All peripheral | |
7 | + */ | |
8 | + | |
9 | +#ifndef ABSTRACTPERIPHERAL_HPP_ | |
10 | +#define ABSTRACTPERIPHERAL_HPP_ | |
11 | + | |
12 | +namespace murasaki { | |
13 | + | |
14 | +/** | |
15 | + * \ingroup MURASAKI_ABSTRACT_GROUP | |
16 | + * @brief Mother of all peripheral class | |
17 | + * @details | |
18 | + * This class provides a common stub for the debugging logger. The loggers sometimes refers the | |
19 | + * raw peripheral to respond to the post motem situaiton. By using class, programmer can pass the | |
20 | + * raw pheripheral handler to loggers, while keep it hidden from the application. | |
21 | + */ | |
22 | +class AbstractPeripheral { | |
23 | +public: | |
24 | + /** | |
25 | + * @brief destructor | |
26 | + */ | |
27 | + virtual ~AbstractPeripheral(){}; | |
28 | +private: | |
29 | + /** | |
30 | + * @brief pass the raw peripheral handler | |
31 | + * @return pointer to the raw peripheral handler hidden in a class. | |
32 | + */ | |
33 | + virtual void * GetPeripheralHandle()=0; | |
34 | +friend class AbstractLogger; | |
35 | +}; | |
36 | + | |
37 | +} /* namespace murasaki */ | |
38 | + | |
39 | +#endif /* ABSTRACTPERIPHERAL_HPP_ */ |
@@ -25,13 +25,6 @@ class AbstractSpiMaster:public murasaki::AbstractPeripheral | ||
25 | 25 | { |
26 | 26 | public: |
27 | 27 | /** |
28 | - * @brief Destructor | |
29 | - */ | |
30 | - virtual ~AbstractSpiMaster() | |
31 | - { | |
32 | - } | |
33 | - ; | |
34 | - /** | |
35 | 28 | * @brief Thread safe, blocking SPI transfer |
36 | 29 | * @param spi_spec Pointer to the SPI slave specifier which has clock configuraiton and chip select handling. |
37 | 30 | * @param tx_data Data to be transmitted |
@@ -40,11 +40,6 @@ namespace murasaki { | ||
40 | 40 | class AbstractUart : public murasaki::AbstractPeripheral { |
41 | 41 | public: |
42 | 42 | |
43 | - /** \brief Destructor. Defined to have a virtual place holder. */ | |
44 | - virtual ~AbstractUart() | |
45 | - { | |
46 | - } | |
47 | - ; | |
48 | 43 | /** |
49 | 44 | * \brief Set the behavior of the hardware flow control |
50 | 45 | * \param control The control mode. |