Vaucanson
1.4.1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
vaucanson
design_pattern
structure.hxx
1
// structure.hxx: this file is part of the Vaucanson project.
2
//
3
// Vaucanson, a generic library for finite state machines.
4
//
5
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 The Vaucanson Group.
6
//
7
// This program is free software; you can redistribute it and/or
8
// modify it under the terms of the GNU General Public License
9
// as published by the Free Software Foundation; either version 2
10
// of the License, or (at your option) any later version.
11
//
12
// The complete GNU General Public Licence Notice can be found as the
13
// `COPYING' file in the root directory.
14
//
15
// The Vaucanson Group consists of people listed in the `AUTHORS' file.
16
//
17
#ifndef VCSN_DESIGN_PATTERN_STRUCTURE_HXX
18
# define VCSN_DESIGN_PATTERN_STRUCTURE_HXX
19
20
# include <
vaucanson/design_pattern/structure.hh
>
21
22
namespace
vcsn {
23
24
/*-----------------------------------.
25
| Delegations for Structure::contain |
26
`-----------------------------------*/
27
28
template
<
typename
S>
29
template
<
typename
T>
30
bool
31
Structure<S>::contains
(
const
Element<S, T>
& elt)
const
32
{
33
return
op_contains
(
self
(), elt.
value
());
34
}
35
36
template
<
typename
S>
37
template
<
typename
T>
38
bool
39
Structure<S>::contains
(
const
T& elt_value)
const
40
{
41
return
op_contains
(
self
(), elt_value);
42
}
43
44
template
<
typename
S>
45
template
<
typename
OtherS,
typename
T>
46
bool
47
Structure<S>::contains
(
const
Element<OtherS, T>
& other)
const
48
{
49
return
false
;
50
}
51
52
/*---------------------------------.
53
| Delegation for Structure::choose |
54
`---------------------------------*/
55
56
template
<
class
S>
57
template
<
class
T>
58
Element<S, T>
59
Structure<S>::choose
(
SELECTOR
(T))
const
60
{
61
return
op_choose(
self
(),
SELECT
(T));
62
}
63
64
/*-------------------------.
65
| Static inheritance stuff |
66
`-------------------------*/
67
68
template
<
typename
S>
69
S&
70
Structure<S>::self
()
71
{
72
return
static_cast<
self_t
&
>
(*this);
73
}
74
75
template
<
typename
S>
76
const
S&
77
Structure<S>::self
()
const
78
{
79
return
static_cast<
const
self_t
&
>
(*this);
80
}
81
82
83
/*-----------------------.
84
| Protected constructors |
85
`-----------------------*/
86
87
template
<
typename
S>
88
Structure<S>::Structure
()
89
: misc::unique::unifiable()
90
{}
91
92
template
<
typename
S>
93
Structure<S>::Structure
(
const
Structure
& other)
94
: misc::unique::unifiable(other)
95
{}
96
97
98
/*--------------------.
99
| Default Comparison |
100
`--------------------*/
101
102
template
<
typename
S>
103
bool
operator != (
const
vcsn::Structure<S>
& a,
104
const
vcsn::Structure<S>
& b)
105
{
return
not (a.
self
() == b.
self
()); }
106
107
}
// vcsn
108
109
#endif // ! VCSN_DESIGN_PATTERN_STRUCTURE_HXX
Generated on Sat Jul 14 2012 18:46:41 for Vaucanson by
1.8.1.1