Adding set and other types
[satune.git] / src / stl-model.h
1 /*      Copyright (c) 2015 Regents of the University of California
2  *
3  *      Author: Brian Demsky <bdemsky@uci.edu>
4  *
5  *      This program is free software; you can redistribute it and/or
6  *      modify it under the terms of the GNU General Public License
7  *      version 2 as published by the Free Software Foundation.
8  */
9
10 #ifndef __STL_MODEL_H__
11 #define __STL_MODEL_H__
12
13 #include <vector>
14 #include <list>
15 #include "mymemory.h"
16
17 template<typename _Tp>
18 class ModelList : public std::list<_Tp, ModelAlloc<_Tp> >
19 {
20 public:
21         typedef std::list< _Tp, ModelAlloc<_Tp> > list;
22
23         ModelList() :
24                 list()
25         { }
26
27         ModelList(size_t n, const _Tp& val = _Tp()) :
28                 list(n, val)
29         { }
30
31         MEMALLOC;
32 };
33
34 template<typename _Tp>
35 class ModelVector : public std::vector<_Tp, ModelAlloc<_Tp> >
36 {
37 public:
38         typedef std::vector< _Tp, ModelAlloc<_Tp> > vector;
39
40         ModelVector() :
41                 vector()
42         { }
43
44         ModelVector(size_t n, const _Tp& val = _Tp()) :
45                 vector(n, val)
46         { }
47
48         MEMALLOC;
49 };
50
51 #endif/* __STL_MODEL_H__ */