Skip to content

Commit

Permalink
#872: standarise making and getting handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Strzebonski committed Oct 30, 2020
1 parent 1b9357d commit b3ff5f6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 13 deletions.
18 changes: 12 additions & 6 deletions src/vt/registry/auto/collection/auto_registry_collection.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ inline AutoActiveCollectionType getAutoHandlerCollection(
HandlerType const& handler
) {
using ContainerType = AutoActiveCollectionContainerType;

auto const han_id = HandlerManagerType::getHandlerIdentifier(handler);
return getAutoRegistryGen<ContainerType>().at(han_id).getFun();
}
Expand All @@ -65,15 +66,18 @@ inline HandlerType makeAutoHandlerCollection() {
using RegInfoType = AutoRegInfoType<AutoActiveCollectionType>;
using FuncType = ActiveColFnPtrType;

auto han = RunnableGen<FunctorT, ContainerType, RegInfoType, FuncType>::idx;
HandlerManager::setHandlerMember(han, false);
return han;
auto const id =
RunnableGen<FunctorT, ContainerType, RegInfoType, FuncType>::idx;
auto handler = HandlerManager::makeHandler(false, false, id);
HandlerManager::setHandlerMember(handler, false);
return handler;
}

inline AutoActiveCollectionMemType getAutoHandlerCollectionMem(
HandlerType const& handler
) {
using ContainerType = AutoActiveCollectionMemContainerType;

auto const han_id = HandlerManagerType::getHandlerIdentifier(handler);
return getAutoRegistryGen<ContainerType>().at(han_id).getFun();
}
Expand All @@ -87,9 +91,11 @@ inline HandlerType makeAutoHandlerCollectionMem() {
using RegInfoType = AutoRegInfoType<AutoActiveCollectionMemType>;
using FuncType = ActiveColMemberFnPtrType;

auto han = RunnableGen<FunctorT, ContainerType, RegInfoType, FuncType>::idx;
HandlerManager::setHandlerMember(han, true);
return han;
auto const id =
RunnableGen<FunctorT, ContainerType, RegInfoType, FuncType>::idx;
auto handler = HandlerManager::makeHandler(false, false, id);
HandlerManager::setHandlerMember(handler, true);
return handler;
}

template <typename ColT, typename MsgT, ActiveColTypedFnType<MsgT, ColT>* f>
Expand Down
19 changes: 14 additions & 5 deletions src/vt/registry/auto/rdma/auto_registry_rdma.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ namespace vt { namespace auto_registry {

inline AutoActiveRDMAPutType getAutoHandlerRDMAPut(HandlerType const& handler) {
using ContainerType = AutoActiveRDMAPutContainerType;
return getAutoRegistryGen<ContainerType>().at(handler).getFun();

auto const han_id = HandlerManager::getHandlerIdentifier(handler);
return getAutoRegistryGen<ContainerType>().at(han_id).getFun();
}

template <typename MsgT, ActiveTypedRDMAPutFnType<MsgT>* f>
Expand All @@ -63,12 +65,17 @@ inline HandlerType makeAutoHandlerRDMAPut() {
using ContainerType = AutoActiveRDMAPutContainerType;
using RegInfoType = AutoRegInfoType<AutoActiveRDMAPutType>;
using FuncType = ActiveRDMAPutFnPtrType;
return RunnableGen<FunctorT, ContainerType, RegInfoType, FuncType>::idx;

auto const id =
RunnableGen<FunctorT, ContainerType, RegInfoType, FuncType>::idx;
return HandlerManager::makeHandler(false, false, id);
}

inline AutoActiveRDMAGetType getAutoHandlerRDMAGet(HandlerType const& handler) {
using ContainerType = AutoActiveRDMAGetContainerType;
return getAutoRegistryGen<ContainerType>().at(handler).getFun();

auto const han_id = HandlerManager::getHandlerIdentifier(handler);
return getAutoRegistryGen<ContainerType>().at(han_id).getFun();
}

template <typename MsgT, ActiveTypedRDMAGetFnType<MsgT>* f>
Expand All @@ -77,9 +84,11 @@ inline HandlerType makeAutoHandlerRDMAGet() {
using ContainerType = AutoActiveRDMAGetContainerType;
using RegInfoType = AutoRegInfoType<AutoActiveRDMAGetType>;
using FuncType = ActiveRDMAGetFnPtrType;
return RunnableGen<FunctorT, ContainerType, RegInfoType, FuncType>::idx;
}

auto const id =
RunnableGen<FunctorT, ContainerType, RegInfoType, FuncType>::idx;
return HandlerManager::makeHandler(false, false, id);
}

}} /* end namespace vt::auto_registry */

Expand Down
9 changes: 7 additions & 2 deletions src/vt/registry/auto/vc/auto_registry_vc_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,17 @@ inline HandlerType makeAutoHandlerVC() {
using ContainerType = AutoActiveVCContainerType;
using RegInfoType = AutoRegInfoType<AutoActiveVCType>;
using FuncType = ActiveVirtualFnPtrType;
return RunnableGen<FunctorT, ContainerType, RegInfoType, FuncType>::idx;

auto const id =
RunnableGen<FunctorT, ContainerType, RegInfoType, FuncType>::idx;
return HandlerManager::makeHandler(false, false, id);
}

inline AutoActiveVCType getAutoHandlerVC(HandlerType const& handler) {
using ContainerType = AutoActiveVCContainerType;
return getAutoRegistryGen<ContainerType>().at(handler).getFun();

auto const han_id = HandlerManager::getHandlerIdentifier(handler);
return getAutoRegistryGen<ContainerType>().at(han_id).getFun();
}

}} // end namespace vt::auto_registry
Expand Down

0 comments on commit b3ff5f6

Please sign in to comment.