circular_queue.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. \file circular_queue.h
  3. \author michael.zohner@ec-spride.de
  4. \copyright ABY - A Framework for Efficient Mixed-protocol Secure Two-party Computation
  5. Copyright (C) 2019 ENCRYPTO Group, TU Darmstadt
  6. This program is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU Lesser General Public License as published
  8. by the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. ABY is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU Lesser General Public License for more details.
  14. You should have received a copy of the GNU Lesser General Public License
  15. along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. \brief Circular Queue class Implementation
  17. */
  18. #ifndef __CQUEUE__
  19. #define __CQUEUE__
  20. class CQueue {
  21. private:
  22. int queuesize;
  23. int head;
  24. int tail;
  25. int* queue;
  26. public:
  27. CQueue(int maxsize);
  28. ~CQueue();
  29. void enq(int ele);
  30. int deq();
  31. int size();
  32. };
  33. #endif