22 #include <bbp/sonata/hdf5_reader.h>
23 #include <bbp/sonata/selection.h>
28 class SONATA_API Population
34 std::string name()
const;
39 uint64_t size()
const;
44 Selection selectAll()
const;
49 const std::set<std::string>& attributeNames()
const;
57 const std::set<std::string>& enumerationNames()
const;
74 std::vector<T> getAttribute(
const std::string& name,
const Selection& selection)
const;
91 std::vector<T> getAttribute(
const std::string& name,
92 const Selection& selection,
93 const T& defaultValue)
const;
106 template <
typename T>
107 std::vector<T> getEnumeration(
const std::string& name,
const Selection& selection)
const;
116 std::vector<std::string> enumerationValues(
const std::string& name)
const;
125 std::string _attributeDataType(
const std::string& name,
126 bool translate_enumeration =
false)
const;
131 const std::set<std::string>& dynamicsAttributeNames()
const;
141 template <
typename T>
142 std::vector<T> getDynamicsAttribute(
const std::string& name,
const Selection& selection)
const;
152 template <
typename T>
153 std::vector<T> getDynamicsAttribute(
const std::string& name,
154 const Selection& selection,
155 const T& defaultValue)
const;
164 std::string _dynamicsAttributeDataType(
const std::string& name)
const;
166 template <
typename T>
167 Selection filterAttribute(
const std::string& name, std::function<
bool(
const T)> pred)
const;
170 Population(
const std::string& h5FilePath,
171 const std::string& csvFilePath,
172 const std::string& name,
173 const std::string& prefix,
174 const Hdf5Reader& hdf5_reader);
176 Population(
const Population&) =
delete;
178 Population(Population&&) noexcept;
180 virtual ~Population() noexcept;
183 std::unique_ptr<Impl> impl_;
187 std::vector<std::
string> Population::getAttribute<std::
string>(const std::
string& name,
188 const Selection& selection) const;
195 template <typename Population>
196 class SONATA_API PopulationStorage
199 PopulationStorage(
const std::string& h5FilePath);
200 PopulationStorage(
const std::string& h5FilePath,
const std::string& csvFilePath);
201 PopulationStorage(
const std::string& h5FilePath,
const Hdf5Reader& hdf5_reader);
202 PopulationStorage(
const std::string& h5FilePath,
203 const std::string& csvFilePath,
204 const Hdf5Reader& hdf5_reader);
206 PopulationStorage(
const PopulationStorage&) =
delete;
208 PopulationStorage(PopulationStorage&&) noexcept;
215 std::set<std::
string> populationNames() const;
222 std::shared_ptr<
Population> openPopulation(const std::
string& name) const;
226 std::unique_ptr<Impl> impl_;