31{
32 void SampleComposite ::
33 testInvariant () const
34 {
35 for (SamplesIter sample = m_samples.begin(),
36 end = m_samples.end(); sample != end; ++ sample)
37 {
39 };
40 }
41
42
43
44 SampleComposite ::
45 SampleComposite ()
46 : Sample ("unnamed")
47 {
49 }
50
51
52
53 SampleComposite ::
54 SampleComposite (const std::string& name)
56 {
58 }
59
60
61
62 void SampleComposite ::
63 add (const SamplePtr& sample)
64 {
69 m_samples.push_back (sample);
70 }
71
72
73
74 std::size_t SampleComposite ::
75 getNumFiles () const
76 {
78 RCU_THROW_MSG (
"Sample::numFiles not supported for SampleComposite");
79 return 0;
80 }
81
82
83
84 std::string SampleComposite ::
85 getFileName (const std::size_t ) const
86 {
88 RCU_THROW_MSG (
"Sample::fileName not supported for SampleComposite");
89 return "";
90 }
91
92
93
94 std::vector<std::string> SampleComposite ::
95 doMakeFileList () const
96 {
98
99 std::vector<std::string>
result;
100 for (SamplesIter sample = m_samples.begin(),
101 end = m_samples.end(); sample != end; ++ sample)
102 {
103 std::vector<std::string> subresult = (*sample)->makeFileList();
104 result.insert (
result.end(), subresult.begin(), subresult.end());
105 }
107 }
108
109
110
111 SamplePtr SampleComposite ::
112 doMakeLocal () const
113 {
115 RCU_THROW_MSG (
"Sample::makeLocal not supported for SampleComposite");
116 return 0;
117 }
118
119
120
121 void SampleComposite ::
122 doUpdateLocation (const std::string& from, const std::string& to)
123 {
125 for (std::vector<SamplePtr>::iterator sample = m_samples.begin(),
126 end = m_samples.end(); sample != end; ++ sample)
127 {
128 (*sample)->updateLocation (from, to);
129 }
130 }
131
132
133
134 bool SampleComposite ::
135 getContains (const std::string& name) const
136 {
138 for (SamplesIter sample = m_samples.begin(),
139 end = m_samples.end(); sample != end; ++ sample)
140 {
141 if ((*sample)->contains (name))
142 return true;
143 };
144 return false;
145 }
146
147
148
149 void SampleComposite ::
150 doAddSamples (SampleHandler&
result)
151 {
153 for (std::vector<SamplePtr>::iterator sample = m_samples.begin(),
154 end = m_samples.end(); sample != end; ++ sample)
155 {
156 (*sample)->addSamples (
result);
157 };
158 }
159}
#define RCU_CHANGE_INVARIANT(x)
#define RCU_NEW_INVARIANT(x)
#define RCU_REQUIRE_SOFT(x)
#define RCU_READ_INVARIANT(x)
#define RCU_THROW_MSG(message)
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring