Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
Botan::Output_Buffers Class Reference

`#include <out_buf.h>`

## Public Member Functions
void | add (class SecureQueue *)
size_t | get_bytes_read (Pipe::message_id) const
Pipe::message_id | message_count () const
| Output_Buffers ()
size_t | peek (uint8_t[], size_t, size_t, Pipe::message_id) const
size_t | read (uint8_t[], size_t, Pipe::message_id)
size_t | remaining (Pipe::message_id) const
void | retire ()
| ~Output_Buffers ()

## Detailed Description

Container of output buffers for Pipe

Definition at line 21 of file out_buf.h.

## Constructor & Destructor Documentation

Botan::Output_Buffers::Output_Buffers | ( |  | ) |

Definition at line 117 of file out_buf.cpp.

118 {
119 m_offset = 0;
120 }

Botan::Output_Buffers::~Output_Buffers | ( |  | ) |

Definition at line 125 of file out_buf.cpp.

126 {
127 for(size_t j = 0; j != m_buffers.size(); ++j)
128 delete m_buffers[j];
129 }

## Member Function Documentation

void Botan::Output_Buffers::add | ( | class SecureQueue * | queue | ) |

Definition at line 64 of file out_buf.cpp.

References BOTAN_ASSERT.

65 {
66 BOTAN_ASSERT(queue, "queue was provided");
67
68 BOTAN_ASSERT(m_buffers.size() < m_buffers.max_size(),
69 "Room was available in container");
70
71 m_buffers.push_back(queue);
72 }
BOTAN_ASSERT
#define BOTAN_ASSERT(expr, assertion_made)
Definition: assert.h:27

size_t Botan::Output_Buffers::get_bytes_read | ( | Pipe::message_id | msg | ) | const

Definition at line 53 of file out_buf.cpp.

References Botan::SecureQueue::get_bytes_read().

Referenced by Botan::Pipe::get_bytes_read().

54 {
55 SecureQueue* q = get(msg);
56 if (q)
57 return q->get_bytes_read();
58 return 0;
59 }

Pipe::message_id Botan::Output_Buffers::message_count | ( |  | ) | const

Definition at line 109 of file out_buf.cpp.

Referenced by Botan::Pipe::message_count().

110 {
111 return (m_offset + m_buffers.size());
112 }

size_t Botan::Output_Buffers::peek | ( | uint8_t | output[],
|  | size_t | length,
|  | size_t | stream_offset,
|  | Pipe::message_id | msg
| ) |  | const

Definition at line 29 of file out_buf.cpp.

References Botan::SecureQueue::peek().

Referenced by Botan::Pipe::peek().

32 {
33 SecureQueue* q = get(msg);
34 if(q)
35 return q->peek(output, length, stream_offset);
36 return 0;
37 }

size_t Botan::Output_Buffers::read | ( | uint8_t | output[],
|  | size_t | length,
|  | Pipe::message_id | msg
| ) |  |

Definition at line 17 of file out_buf.cpp.

References Botan::SecureQueue::read().

Referenced by Botan::Pipe::read().

19 {
20 SecureQueue* q = get(msg);
21 if(q)
22 return q->read(output, length);
23 return 0;
24 }

size_t Botan::Output_Buffers::remaining | ( | Pipe::message_id | msg | ) | const

Definition at line 42 of file out_buf.cpp.

References Botan::SecureQueue::size().

Referenced by Botan::Pipe::remaining().

43 {
44 SecureQueue* q = get(msg);
45 if(q)
46 return q->size();
47 return 0;
48 }

void Botan::Output_Buffers::retire | ( |  | ) |

Definition at line 77 of file out_buf.cpp.

Referenced by Botan::Pipe::end_msg().

78 {
79 for(size_t i = 0; i != m_buffers.size(); ++i)
80 if(m_buffers[i] && m_buffers[i]->size() == 0)
81 {
82 delete m_buffers[i];
83 m_buffers[i] = nullptr;
84 }
85
86 while(m_buffers.size() && !m_buffers[0])
87 {
88 m_buffers.pop_front();
89 m_offset = m_offset + Pipe::message_id(1);
90 }
91 }
Botan::Pipe::message_id
size_t message_id
Definition: pipe.h:33

The documentation for this class was generated from the following files:

- src/lib/filters/out_buf.h
- src/lib/filters/out_buf.cpp