2 Bacula(R) - The Network Backup Solution
4 Copyright (C) 2000-2017 Kern Sibbald
6 The original author of Bacula is Kern Sibbald, with contributions
7 from many others, a complete list can be found in the file AUTHORS.
9 You may use this file and others of this release according to the
10 license defined in the LICENSE file, which includes the Affero General
11 Public License, v3.0 ("AGPLv3") and some additional permissions and
12 terms pursuant to its AGPLv3 Section 7.
14 This notice must be preserved when any source code is
15 conveyed and/or propagated.
17 Bacula(R) is a registered trademark of Kern Sibbald.
20 * Kern Sibbald, August 2014.
23 /* Second arg of init */
25 owned_by_flist = true,
26 not_owned_by_flist = false
30 * Fifo list -- derived from alist
32 class flist : public SMARTALLOC {
40 flist(int num = 10, bool own=false);
42 void init(int num = 10, bool own=false);
43 bool queue(void *item);
51 inline bool flist::empty() const
53 return num_items == 0;
56 inline bool flist::full() const
58 return num_items == max_items;
62 * This allows us to do explicit initialization,
63 * allowing us to mix C++ classes inside malloc'ed
64 * C structures. Define before called in constructor.
66 inline void flist::init(int num, bool own)
74 items = (void **)malloc(max_items * sizeof(void *));
78 inline flist::flist(int num, bool own)
84 inline flist::~flist()
91 /* Current size of list */
92 inline int flist::size() const