YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
Set.hxx
Go to the documentation of this file.
1
#ifndef YAPOG_SET_HXX
2
# define YAPOG_SET_HXX
3
4
# include "
YAPOG/Macros.hpp
"
5
6
namespace
yap
7
{
8
namespace
collection
9
{
10
template
<
typename
T,
typename
C>
11
inline
Set<T, C>::Set
()
12
: data_ ()
13
{
14
}
15
16
template
<
typename
T,
typename
C>
17
inline
Set<T, C>::Set
(
const
Set<T, C>
& copy)
18
: data_ (copy.data_)
19
{
20
}
21
22
template
<
typename
T,
typename
C>
23
inline
Set<T, C>
&
Set<T, C>::operator=
(
const
Set<T, C>
& copy)
24
{
25
if
(© ==
this
)
26
return
*
this
;
27
28
data_ = copy.
data_
;
29
30
return
*
this
;
31
}
32
33
template
<
typename
T,
typename
C>
34
inline
typename
Set<T, C>::ItType
Set<T, C>::begin
()
35
{
36
return
data_.begin ();
37
}
38
39
template
<
typename
T,
typename
C>
40
inline
typename
Set<T, C>::ConstItType
Set<T, C>::begin
()
const
41
{
42
return
data_.begin ();
43
}
44
45
template
<
typename
T,
typename
C>
46
inline
typename
Set<T, C>::ItType
Set<T, C>::Begin
()
47
{
48
return
begin ();
49
}
50
51
template
<
typename
T,
typename
C>
52
inline
typename
Set<T, C>::ConstItType
Set<T, C>::Begin
()
const
53
{
54
return
begin ();
55
}
56
57
template
<
typename
T,
typename
C>
58
inline
typename
Set<T, C>::ItType
Set<T, C>::end
()
59
{
60
return
data_.end ();
61
}
62
63
template
<
typename
T,
typename
C>
64
inline
typename
Set<T, C>::ConstItType
Set<T, C>::end
()
const
65
{
66
return
data_.end ();
67
}
68
69
template
<
typename
T,
typename
C>
70
inline
typename
Set<T, C>::ItType
Set<T, C>::End
()
71
{
72
return
end ();
73
}
74
75
template
<
typename
T,
typename
C>
76
inline
typename
Set<T, C>::ConstItType
Set<T, C>::End
()
const
77
{
78
return
end ();
79
}
80
81
template
<
typename
T,
typename
C>
82
inline
bool
Set<T, C>::Add
(
const
T& data)
83
{
84
return
data_.insert (data).second;
85
}
86
87
template
<
typename
T,
typename
C>
88
inline
void
Set<T, C>::Add
(
const
Set<T, C>
& data)
89
{
90
data_.insert (data.
Begin
(), data.
End
());
91
}
92
93
template
<
typename
T,
typename
C>
94
inline
bool
Set<T, C>::Contains
(
const
T& data)
const
95
{
96
return
data_.find (data) != End ();
97
}
98
99
template
<
typename
T,
typename
C>
100
inline
bool
Set<T, C>::Contains
(
const
Set<T, C>
& data)
const
101
{
102
for
(
const
T& t : *
this
)
103
if
(Contains (t))
104
return
true
;
105
106
return
false
;
107
}
108
109
template
<
typename
T,
typename
C>
110
inline
bool
Set<T, C>::Remove
(
const
T& data)
111
{
112
return
data_.erase (data) == 1;
113
}
114
115
template
<
typename
T,
typename
C>
116
inline
void
Set<T, C>::Clear
()
117
{
118
data_.clear ();
119
}
120
121
template
<
typename
T,
typename
C>
122
inline
bool
Set<T, C>::IsEmpty
()
const
123
{
124
return
data_.empty ();
125
}
126
127
template
<
typename
T,
typename
C>
128
inline
typename
Set<T, C>::SizeType
Set<T, C>::Count
()
const
129
{
130
return
data_.size ();
131
}
132
}
// namespace collection
133
}
// namespace yap
134
135
#endif // YAPOG_SET_HXX
YAPOG
include
YAPOG
Collection
Set.hxx
Generated on Mon Sep 17 2012 22:24:22 for YAPOG by
1.8.1.1