Botan  2.11.0
Crypto and TLS for C++11
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 
9 namespace Botan {
10 
11 /*
12 * Chain Constructor
13 */
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 */
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 */
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 */
47 Fork::Fork(Filter* filters[], size_t count)
48  {
49  set_next(filters, count);
50  }
51 
52 }
void attach(Filter *f)
Definition: filter.h:156
void set_next(Filter *f[], size_t n)
Definition: filter.h:154
Fork(Filter *, Filter *, Filter *=nullptr, Filter *=nullptr)
Definition: basefilt.cpp:38
Definition: alg_id.cpp:13
Chain(Filter *=nullptr, Filter *=nullptr, Filter *=nullptr, Filter *=nullptr)
Definition: basefilt.cpp:14