Newer
Older
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef SWIG_LIBWCCL_WCCLFILEOPSECTIONS_I
#define SWIG_LIBWCCL_WCCLFILEOPSECTIONS_I
%module libcclwcclfileopsections
%{
#include <libwccl/wcclfileopsections.h>
%}
%include "libcclbool.i"
%include "libcclmatch.i"
%include "libcclposition.i"
%include "libcclstrset.i"
%include "libccltset.i"
%include "libcclvalue.i"
%include "libcclfunctionalopsequence.i"
%include "std_string.i"
%include "std_vector.i"
%include "boost_shared_ptr.i"
namespace Wccl {
template<class T> class WcclFileOpSections {
public:
typedef typename T::op_t op_t;
typedef typename boost::shared_ptr<op_t> op_ptr_t;
typedef typename boost::shared_ptr<const op_t> op_ptr_c_t;
typedef typename boost::shared_ptr<T> ptr_t;
typedef typename boost::shared_ptr<const T> ptr_c_t;
typedef typename std::vector<ptr_t> ptr_v_t;
typedef typename boost::unordered_map<std::string, ptr_t> map_t;
typedef typename T::name_op_v_t name_op_v_t;
typedef typename T::name_op_v_c_t name_op_v_c_t;
/* --------------------------------------------------------------------- */
protected:
bool has_section(const std::string& name) const;
const ptr_v_t& sections();
/* --------------------------------------------------------------------- */
size_t size() const;
bool empty() const;
/* --------------------------------------------------------------------- */
std::vector<std::string> section_names() const;
/* --------------------------------------------------------------------- */
T& get_section(const std::string& name);
const T& get_section(const std::string& name) const;
/* --------------------------------------------------------------------- */
ptr_t get_section_ptr(const std::string& name);
ptr_c_t get_section_ptr(const std::string& name) const;
/* --------------------------------------------------------------------- */
op_t& get_op(const std::string& name, size_t idx = 0);
const op_t& get_op(const std::string& name, size_t idx = 0) const;
/* --------------------------------------------------------------------- */
op_ptr_t get_op_ptr(const std::string& name, size_t idx = 0);
op_ptr_c_t get_op_ptr(const std::string& name, size_t idx = 0) const;
/* --------------------------------------------------------------------- */
name_op_v_t& add_name_op_pairs(name_op_v_t& pairs);
name_op_v_c_t& add_name_op_pairs(name_op_v_c_t& pairs) const;
/* --------------------------------------------------------------------- */
name_op_v_t gen_name_op_pairs();
name_op_v_c_t gen_name_op_pairs() const;
/* --------------------------------------------------------------------- */
WcclFileOpSections();
void append(const ptr_t& section);
/* --------------------------------------------------------------------- */
};
%template(UntypedOpSequenceWcclFileOpSections) WcclFileOpSections<UntypedOpSequence>;
%template(StrSetOpSequence) WcclFileOpSections<OpSequence<StrSet> >;
%template(TSetOpSequence) WcclFileOpSections<OpSequence<TSet> >;
%template(BoolOpSequence) WcclFileOpSections<OpSequence<Bool> >;
%template(PositionOpSequence) WcclFileOpSections<OpSequence<Position> >;
%template(MatchOpSequence) WcclFileOpSections<OpSequence<Match> >;
%template(OpSequenceStrSet) Wccl::WcclFileOpSections<Wccl::OpSequence<Wccl::StrSet> >;
}
using namespace std;
using namespace Wccl;
#endif /* SWIG_LIBWCCL_WCCLFILEOPSECTIONS_I */