10#define BOTAN_FILTER_H_
12#include <botan/secmem.h>
26 virtual std::string
name()
const = 0;
33 virtual void write(
const uint8_t input[],
size_t length) = 0;
65 virtual void send(
const uint8_t in[],
size_t length);
75 template <
typename Alloc>
76 void send(
const std::vector<uint8_t, Alloc>& in) {
77 send(in.data(), in.size());
84 template <
typename Alloc>
85 void send(
const std::vector<uint8_t, Alloc>& in,
size_t length) {
87 send(in.data(), length);
107 friend class Threaded_Fork;
109 size_t total_ports()
const;
111 size_t current_port()
const {
return m_port_num; }
117 void set_port(
size_t new_port);
119 size_t owns()
const {
return m_filter_owns; }
125 void attach(Filter* f);
131 void set_next(Filter* filters[],
size_t count);
132 Filter* get_next()
const;
134 secure_vector<uint8_t> m_write_queue;
135 std::vector<Filter*> m_next;
136 size_t m_port_num, m_filter_owns;
#define BOTAN_ASSERT_NOMSG(expr)
void set_next(Filter *f[], size_t n)
Filter(const Filter &)=delete
virtual ~Filter()=default
virtual std::string name() const =0
virtual bool attachable()
void send(const std::vector< uint8_t, Alloc > &in)
virtual void write(const uint8_t input[], size_t length)=0
Filter & operator=(const Filter &)=delete
void send(const std::vector< uint8_t, Alloc > &in, size_t length)
#define BOTAN_PUBLIC_API(maj, min)