Botan 1.10.17

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

`#include <out_buf.h>`

## Public Member Functions
void | add (class SecureQueue *)
Pipe::message_id | message_count () const
| Output_Buffers ()
size_t | peek (byte[], size_t, size_t, Pipe::message_id) const
size_t | read (byte[], 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 20 of file out_buf.h.

## Constructor & Destructor Documentation

## ◆ Output_Buffers()

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

Definition at line 107 of file out_buf.cpp.

108 {
109 offset = 0;
110 }

## ◆ ~Output_Buffers()

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

Definition at line 115 of file out_buf.cpp.

116 {
117 for(size_t j = 0; j != buffers.size(); ++j)
118 delete buffers[j];
119 }

## Member Function Documentation

## ◆ add()

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

Definition at line 53 of file out_buf.cpp.

References BOTAN_ASSERT.

54 {
55 BOTAN_ASSERT(queue, "argument was NULL");
56
57 BOTAN_ASSERT(buffers.size() < buffers.max_size(),
58 "No more room in container");
59
60 buffers.push_back(queue);
61 }
BOTAN_ASSERT
#define BOTAN_ASSERT(expr, msg)
Definition: assert.h:19

## ◆ message_count()

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

Definition at line 99 of file out_buf.cpp.

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

100 {
101 return (offset + buffers.size());
102 }

## ◆ peek()

size_t Botan::Output_Buffers::peek | ( | byte | 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 }

## ◆ read()

size_t Botan::Output_Buffers::read | ( | byte | 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 }

## ◆ remaining()

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 }

## ◆ retire()

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

Definition at line 66 of file out_buf.cpp.

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

67 {
68 for(size_t i = 0; i != buffers.size(); ++i)
69 if(buffers[i] && buffers[i]->size() == 0)
70 {
71 delete buffers[i];
72 buffers[i] = 0;
73 }
74
75 while(buffers.size() && !buffers[0])
76 {
77 buffers.pop_front();
78 offset = offset + Pipe::message_id(1);
79 }
80 }
Botan::Pipe::message_id
size_t message_id
Definition: pipe.h:31

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

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