blob: d0b62d9ff23e0f4f149998f794c538ae7ac06f8f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#ifndef COLUMNS_H
#define COLUMNS_H
#include "variables.h"
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/ordered_index.hpp>
class Column : public IntrusivePtrBase {
public:
Column(unsigned int idx, ScriptNodePtr p);
Column(unsigned int i, const Glib::ustring & n, const Variable & v = Variable(Null()));
static Column * make(unsigned int idx, ScriptNodePtr p);
const unsigned int idx;
const Glib::ustring name;
const Variable defValue;
};
struct byColIdx {};
struct byColName {};
typedef boost::multi_index::multi_index_container<boost::intrusive_ptr<Column>,
boost::multi_index::indexed_by<
boost::multi_index::ordered_unique<
boost::multi_index::tag<byColName>, BOOST_MULTI_INDEX_MEMBER(Column, const Glib::ustring, name)>,
boost::multi_index::ordered_unique<
boost::multi_index::tag<byColIdx>, BOOST_MULTI_INDEX_MEMBER(Column, const unsigned int, idx)>
> > Columns;
#endif
|