NAGASH 0.9.8
Next Generation Analysis System
Loading...
Searching...
No Matches
Toolkit.h
Go to the documentation of this file.
1//***************************************************************************************
4//***************************************************************************************
5
6#pragma once
7
8#include "NAGASH/Global.h"
9#include "NAGASH/Tool.h"
10
11namespace NAGASH
12{
16 class Toolkit
17 {
18 public:
21 Toolkit(std::shared_ptr<MSGTool> MSG) : msg(MSG) {}
22 Toolkit() = delete;
23
24 template <typename T, typename... Args>
25 std::shared_ptr<T> GetTool(Args &&...args);
26
27 private:
28 std::shared_ptr<MSGTool> msg;
29 };
30
36 template <typename T, typename... Args>
37 inline std::shared_ptr<T> Toolkit::GetTool(Args &&...args)
38 {
39 static_assert(!std::is_pointer<T>::value, "class Toolkit: Can not book tool in pointer type");
40 static_assert(std::is_base_of<Tool, T>::value, "class Toolkit: Input type must be or be inherited from Tool class");
41 return std::make_shared<T>(msg, std::forward<Args>(args)...);
42 }
43
44} // namespace NAGASH
Some global definitions.
Manipulate the Tool classes, give them correct MSGTool inside NAGASH::Job.
Definition Toolkit.h:17
std::shared_ptr< T > GetTool(Args &&...args)
Create a new tool with the MSGTool inside.
Definition Toolkit.h:37
std::shared_ptr< MSGTool > msg
Definition Toolkit.h:28
Toolkit()=delete
Toolkit(std::shared_ptr< MSGTool > MSG)
Constructor.
Definition Toolkit.h:21