aboutsummaryrefslogtreecommitdiff
path: root/odb/traversal/relational/key.hxx
blob: b00adda9b62f25e2d38533325285c3620ff60edc (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
// file      : odb/traversal/relational/key.hxx
// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
// license   : GNU GPL v3; see accompanying LICENSE file

#ifndef ODB_TRAVERSAL_RELATIONAL_KEY_HXX
#define ODB_TRAVERSAL_RELATIONAL_KEY_HXX

#include <odb/semantics/relational/key.hxx>
#include <odb/traversal/relational/elements.hxx>

namespace traversal
{
  namespace relational
  {
    template <typename T>
    struct key_template: node<T>
    {
    public:
      virtual void
      traverse (T& k)
      {
        contains (k);
      }

      virtual void
      contains (T& k)
      {
        contains (k, *this);
      }

      virtual void
      contains (T& k, edge_dispatcher& d)
      {
        iterate_and_dispatch (k.contains_begin (), k.contains_end (), d);
      }
    };

    struct key: key_template<semantics::relational::key> {};
  }
}

#endif // ODB_TRAVERSAL_RELATIONAL_KEY_HXX