16 template <
class AnyType>
21 std::vector<AnyType> m_vData;
28 AnyType& fetch (
unsigned i) { assert(i < m_vData.size());
return m_vData[i]; };
29 AnyType
get (
unsigned i)
const { assert(i < m_vData.size());
return m_vData[i]; };
31 void insert (
unsigned i,
const AnyType val) { m_vData.insert(m_vData.begin() + i, val); };
32 void remove (
unsigned i) {
33 assert(i >=0 && i < m_vData.size());
34 m_vData.erase(m_vData.begin()+i);
36 void exchange (
unsigned i,
unsigned j) {
37 assert(i >=0 && i < m_vData.size() && j >=0 && j < m_vData.size());
38 AnyType tmp=m_vData[i]; m_vData[i]=m_vData[j]; m_vData[j]=tmp;
42 void addh(
const AnyType& val) { m_vData.push_back(val); };
43 void addhn(
unsigned n) { m_vData.resize(m_vData.size()+n); };
45 void clean() { m_vData.clear(); }
46 int count()
const {
return m_vData.size(); }
48 AnyType& operator[] (
unsigned i) {
return fetch(i); };
49 AnyType operator() (
unsigned i)
const {
return get(i); };
51 std::vector<AnyType>& get_data() {
return m_vData;}
63 std::deque<bool> m_vData;
70 bool& fetch (
unsigned i) { assert(i < m_vData.size());
return m_vData[i]; };
71 bool get (
unsigned i)
const { assert(i < m_vData.size());
return m_vData[i]; };
73 void insert (
unsigned i,
bool val) { m_vData.insert(m_vData.begin() + i, val); };
74 void addh(
const bool& val) { m_vData.push_back(val); };
75 void addhn(
unsigned n) { m_vData.resize(m_vData.size() + n); };
77 void clean() { m_vData.clear(); }
78 int count()
const {
return m_vData.size(); }
80 bool& operator[] (
unsigned i) {
return fetch(i); };
81 bool operator() (
unsigned i)
const {
return get(i); };
83 std::deque<bool>& get_data() {
return m_vData;}
Definition: objectar.hpp:59
Definition: objectar.hpp:57
Definition: objectar.hpp:55
Definition: objectar.hpp:56
Definition: objectar.hpp:17