mn_workqueue_item.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of the Mini Thread Library (https://github.com/RoseLeBlood/MiniThread ).
3  * Copyright (c) 2020 Amber-Sophia Schroeck
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, version 3.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 #ifndef MINLIB_ESP32_WORK_ITEM_QUEUE_
18 #define MINLIB_ESP32_WORK_ITEM_QUEUE_
19 
20 namespace mn {
21  namespace queue {
31  public:
43  work_queue_item(bool deleteAffter = false)
44  : m_bCanDelete(deleteAffter) { }
45 
49  virtual ~work_queue_item() { }
50 
55  bool can_delete() { return m_bCanDelete; }
56 
61  virtual bool on_work() = 0;
62  private:
63  const bool m_bCanDelete;
64  };
65 
67  }
68 }
69 
70 #endif
Definition: mn_workqueue_item.hpp:30
const bool m_bCanDelete
Definition: mn_workqueue_item.hpp:63
bool can_delete()
Definition: mn_workqueue_item.hpp:55
virtual bool on_work()=0
work_queue_item(bool deleteAffter=false)
Definition: mn_workqueue_item.hpp:43
virtual ~work_queue_item()
Definition: mn_workqueue_item.hpp:49
basic_queue< T, TMAXITEMS, TITEMSIZE > queue
Definition: container/mn_queue.hpp:239
Definition: mn_allocator_typetraits.hpp:25