Fenix @develop
 
Loading...
Searching...
No Matches
component.hpp
1#ifndef FENIX_DATA_COMPONENT_HPP
2#define FENIX_DATA_COMPONENT_HPP
3
4#include <memory>
5#include <set>
6#include <vector>
7#include <source_location>
8#include "fenix/data/group.hpp"
9
10namespace fenix::data {
11
13 public:
14 DataComponent() = default;
16
17 std::set<std::shared_ptr<DataGroup>, DataGroupIdComparator> groups;
18 std::vector<int> group_order;
19
20 // Search for group by id, returning null if not found
21 DataGroup* search_group(int id);
22 DataMember* search_member(int groupid, int memberid);
23
24 // As search functions, but throw if not found
25 DataGroup* find_group(
26 int id, std::source_location loc = std::source_location::current()
27 );
28 DataMember* find_member(
29 int groupid, int memberid,
30 std::source_location loc = std::source_location::current()
31 );
32
33 // Create and add a group to the component
34 void group_create(
35 int groupid, MPI_Comm comm, int timestart, int depth, int policy_name,
36 void* policy_value
37 );
38
39 // Remove a group by id
40 void remove_group(int id);
41
42 // Revoke all group cohort communicators
43 void revoke();
44
45 // Get number of groups
46 size_t count() const { return groups.size(); }
47};
48
49} // namespace fenix::data
50
51#endif // FENIX_DATA_COMPONENT_HPP
Definition component.hpp:12
Definition member.hpp:76
Definition group.hpp:162
Definition group.hpp:78