SCM Library
Spherical Cube Map rendering library
 All Classes Files Functions Variables Friends Pages
scm-fifo.hpp
1 // Copyright (C) 2011-2012 Robert Kooima
2 //
3 // LIBSCM is free software; you can redistribute it and/or modify it under the
4 // terms of the GNU General Public License as published by the Free Software
5 // Foundation; either version 2 of the License, or (at your option) any later
6 // version.
7 //
8 // This program is distributed in the hope that it will be useful, but WITH-
9 // OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 // more details.
12 
13 #ifndef SCM_FIFO_HPP
14 #define SCM_FIFO_HPP
15 
16 #include <list>
17 
18 //------------------------------------------------------------------------------
19 
21 
22 template <typename T> class scm_fifo : public std::list <T>
23 {
24 public:
25 
27 
28  void enq(T p) {
29  this->push_back(p);
30  }
31 
33 
34  T deq() {
35  T p = this->front();
36  this->pop_front();
37  return p;
38  }
39 };
40 
41 //------------------------------------------------------------------------------
42 
43 #endif
T deq()
Dequeue and return a value.
Definition: scm-fifo.hpp:34
An scm_fifo implements a simple first-in-first-out templated queue.
Definition: scm-fifo.hpp:22
void enq(T p)
Enqueue a value.
Definition: scm-fifo.hpp:28