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
9 namespace Botan {
10
11 /*
12 * Chain Constructor
13 */
Chain(Filter * f1,Filter * f2,Filter * f3,Filter * f4)14 Chain::Chain(Filter* f1, Filter* f2, Filter* f3, Filter* f4)
15 {
16 if(f1) { attach(f1); incr_owns(); }
17 if(f2) { attach(f2); incr_owns(); }
18 if(f3) { attach(f3); incr_owns(); }
19 if(f4) { attach(f4); incr_owns(); }
20 }
21
22 /*
23 * Chain Constructor
24 */
Chain(Filter * filters[],size_t count)25 Chain::Chain(Filter* filters[], size_t count)
26 {
27 for(size_t j = 0; j != count; ++j)
28 if(filters[j])
29 {
30 attach(filters[j]);
31 incr_owns();
32 }
33 }
34
35 /*
36 * Fork Constructor
37 */
Fork(Filter * f1,Filter * f2,Filter * f3,Filter * f4)38 Fork::Fork(Filter* f1, Filter* f2, Filter* f3, Filter* f4)
39 {
40 Filter* filters[4] = { f1, f2, f3, f4 };
41 set_next(filters, 4);
42 }
43
44 /*
45 * Fork Constructor
46 */
Fork(Filter * filters[],size_t count)47 Fork::Fork(Filter* filters[], size_t count)
48 {
49 set_next(filters, count);
50 }
51
52 }
53