Botan 3.4.0
Crypto and TLS for C&
basefilt.cpp
Go to the documentation of this file.
1/*
2* (C) 1999-2007 Jack Lloyd
3*
4* Botan is released under the Simplified BSD License (see license.txt)
5*/
6
7#include <botan/filters.h>
8
9namespace Botan {
10
11/*
12* Chain Constructor
13*/
14Chain::Chain(Filter* f1, Filter* f2, Filter* f3, Filter* f4) {
15 if(f1) {
16 attach(f1);
17 incr_owns();
18 }
19 if(f2) {
20 attach(f2);
21 incr_owns();
22 }
23 if(f3) {
24 attach(f3);
25 incr_owns();
26 }
27 if(f4) {
28 attach(f4);
29 incr_owns();
30 }
31}
32
33/*
34* Chain Constructor
35*/
36Chain::Chain(Filter* filters[], size_t count) {
37 for(size_t j = 0; j != count; ++j) {
38 if(filters[j]) {
39 attach(filters[j]);
40 incr_owns();
41 }
42 }
43}
44
45/*
46* Fork Constructor
47*/
48Fork::Fork(Filter* f1, Filter* f2, Filter* f3, Filter* f4) {
49 Filter* filters[4] = {f1, f2, f3, f4};
50 set_next(filters, 4);
51}
52
53/*
54* Fork Constructor
55*/
56Fork::Fork(Filter* filters[], size_t count) {
57 set_next(filters, count);
58}
59
60} // namespace Botan
Chain(Filter *=nullptr, Filter *=nullptr, Filter *=nullptr, Filter *=nullptr)
Definition basefilt.cpp:14
void set_next(Filter *f[], size_t n)
Definition filter.h:154
void attach(Filter *f)
Definition filter.h:156
Fork(Filter *, Filter *, Filter *=nullptr, Filter *=nullptr)
Definition basefilt.cpp:48