blob: 18439be93a32a74fc68c0ae5c8d479a4783e3979 (
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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
// file : odb/semantics/relational/key.hxx
// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
// license : GNU GPL v3; see accompanying LICENSE file
#ifndef ODB_SEMANTICS_RELATIONAL_KEY_HXX
#define ODB_SEMANTICS_RELATIONAL_KEY_HXX
#include <odb/semantics/relational/elements.hxx>
namespace semantics
{
namespace relational
{
class key;
class column;
class contains: public edge
{
public:
typedef relational::key key_type;
typedef relational::column column_type;
key_type&
key () const
{
return *key_;
}
column_type&
column () const
{
return *column_;
}
string const&
options () const
{
return options_;
}
public:
contains (string const& o = string ()) : options_ (o) {}
void
set_left_node (key_type& n)
{
key_ = &n;
}
void
set_right_node (column_type& n)
{
column_ = &n;
}
protected:
key_type* key_;
column_type* column_;
string options_;
};
class key: public unameable
{
typedef std::vector<contains*> contains_list;
public:
typedef
pointer_iterator<contains_list::const_iterator>
contains_iterator;
contains_iterator
contains_begin () const
{
return contains_.begin ();
}
contains_iterator
contains_end () const
{
return contains_.end ();
}
contains_list::size_type
contains_size () const
{
return contains_.size ();
}
public:
key (std::string const& id): unameable (id) {}
void
add_edge_left (contains& e)
{
contains_.push_back (&e);
}
private:
contains_list contains_;
};
}
}
#endif // ODB_SEMANTICS_RELATIONAL_KEY_HXX
|