irioCoreCpp Library Module  2.1.0
profileBase.h
1 #pragma once
2 
3 #include <typeindex>
4 #include <unordered_map>
5 #include <memory>
6 
7 #include "terminals/terminals.h"
8 #include "profilesTypes.h"
9 
10 
11 namespace irio {
12 
22 class ProfileBase {
23  public:
32  explicit ProfileBase(ParserManager *parserManager,
33  const NiFpga_Session &session, const PROFILE_ID &id);
34 
43  template<typename T>
44  T getTerminal() const;
45 
49  const PROFILE_ID profileID;
50 
51  protected:
58  template<typename T>
59  void addTerminal(T terminal);
60 
61  private:
63  std::unordered_map<std::type_index,
64  std::unique_ptr<TerminalsBase>> m_mapTerminals;
65 };
66 
67 } // namespace irio
Responsible for managing the parsing of resources for a bitfile.
Definition: parserManager.h:76
Base profile class.
Definition: profileBase.h:22
void addTerminal(T terminal)
Adds a terminal to the profile.
const PROFILE_ID profileID
Profile type.
Definition: profileBase.h:49
ProfileBase(ParserManager *parserManager, const NiFpga_Session &session, const PROFILE_ID &id)
Allows the user to access terminals for read/write operations.
std::unordered_map< std::type_index, std::unique_ptr< TerminalsBase > > m_mapTerminals
Associates a Terminal type to the actual instance of the terminal.
Definition: profileBase.h:64
T getTerminal() const
Returns the specified terminal if it is present in the current profile.