テスト用のあれこれ共用フォルダ
修订版 | a72d2b1f2ab76e58a0a0eb93680d4d9561682c8f (tree) |
---|---|
时间 | 2018-03-01 06:09:48 |
作者 | takemasa <suikan@user...> |
Commiter | takemasa |
Change the name of the class
@@ -5,14 +5,14 @@ | ||
5 | 5 | * Author: takemasa |
6 | 6 | */ |
7 | 7 | |
8 | -#include <basefifo.hpp> | |
8 | +#include <abstractfifo.hpp> | |
9 | 9 | #include <murasaki_assert.hpp> |
10 | 10 | #include <algorithm> |
11 | 11 | #include <string.h> |
12 | 12 | |
13 | 13 | namespace murasaki { |
14 | 14 | |
15 | -BaseFifo::BaseFifo(unsigned int buffer_size): | |
15 | +AbstractFifo::AbstractFifo(unsigned int buffer_size): | |
16 | 16 | size_of_buffer_(buffer_size), |
17 | 17 | buffer_(new uint8_t[size_of_buffer_]) |
18 | 18 | { |
@@ -29,13 +29,13 @@ BaseFifo::BaseFifo(unsigned int buffer_size): | ||
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | -BaseFifo::~BaseFifo() | |
32 | +AbstractFifo::~AbstractFifo() | |
33 | 33 | { |
34 | 34 | if (buffer_ != nullptr) |
35 | 35 | delete[] buffer_; |
36 | 36 | } |
37 | 37 | |
38 | -unsigned int BaseFifo::Put(uint8_t const data[], unsigned int size) | |
38 | +unsigned int AbstractFifo::Put(uint8_t const data[], unsigned int size) | |
39 | 39 | { |
40 | 40 | unsigned int avairable; |
41 | 41 |
@@ -72,7 +72,7 @@ unsigned int BaseFifo::Put(uint8_t const data[], unsigned int size) | ||
72 | 72 | |
73 | 73 | } |
74 | 74 | |
75 | -unsigned int BaseFifo::Get(uint8_t data[], unsigned int size) | |
75 | +unsigned int AbstractFifo::Get(uint8_t data[], unsigned int size) | |
76 | 76 | { |
77 | 77 | unsigned int copy_size = 0; |
78 | 78 |
@@ -103,7 +103,7 @@ unsigned int BaseFifo::Get(uint8_t data[], unsigned int size) | ||
103 | 103 | return copy_size; |
104 | 104 | } |
105 | 105 | |
106 | -void BaseFifo::ReWind() | |
106 | +void AbstractFifo::ReWind() | |
107 | 107 | { |
108 | 108 | // by setting tail as head+1, the entire buffer is marked as "not sent" |
109 | 109 | tail_ = head_ + 1; |
@@ -5,8 +5,8 @@ | ||
5 | 5 | * @author takemasa |
6 | 6 | */ |
7 | 7 | |
8 | -#ifndef BASEFIFO_HPP_ | |
9 | -#define BASEFIFO_HPP_ | |
8 | +#ifndef ABSTRACTFIFO_HPP_ | |
9 | +#define ABSTRACTFIFO_HPP_ | |
10 | 10 | |
11 | 11 | #include <ctype.h> |
12 | 12 | #include <cinttypes> |
@@ -25,21 +25,21 @@ namespace murasaki { | ||
25 | 25 | * If the internal buffer is empty, it returns without copy data. |
26 | 26 | * |
27 | 27 | */ |
28 | -class BaseFifo | |
28 | +class AbstractFifo | |
29 | 29 | { |
30 | 30 | public: |
31 | - BaseFifo() = delete; | |
31 | + AbstractFifo() = delete; | |
32 | 32 | /** |
33 | 33 | * @brief Create an internal buffer |
34 | 34 | * @param buffer_size Size of the internal buffer to be allocated [byte] |
35 | 35 | * @details |
36 | 36 | * Allocate the internal buffer with given buffer_size. |
37 | 37 | */ |
38 | - BaseFifo(unsigned int buffer_size); | |
38 | + AbstractFifo(unsigned int buffer_size); | |
39 | 39 | /** |
40 | 40 | * @breif Delete an internal buffer |
41 | 41 | */ |
42 | - virtual ~BaseFifo(); | |
42 | + virtual ~AbstractFifo(); | |
43 | 43 | /** |
44 | 44 | * @brief Put the data into the internal buffer. |
45 | 45 | * @param data Data to be copied to the internal buffer |
@@ -82,4 +82,4 @@ class BaseFifo | ||
82 | 82 | |
83 | 83 | } /* namespace murasaki */ |
84 | 84 | |
85 | -#endif /* BASEFIFO_HPP_ */ | |
85 | +#endif /* ABSTRACTFIFO_HPP_ */ |