FpgaManager
Software API Documentation
FpgaManager.h
1 
2 #pragma once
3 
4 // ================================================================================
5 // PUBLIC INCLUDES
6 // ================================================================================
7 
8 #include "FpgaManager_Types.h"
9 #include "FpgaManager_Config.h"
10 #include "FpgaManager_Drivers.h"
11 #include "FpgaManager_Interfaces.h"
12 #include "FpgaManager_Utilities.h"
13 
14 #include <cstdint>
15 #include <functional>
16 #include <memory>
17 #include <array>
18 
23 
24 // ================================================================================
25 // NAMESPACE
26 // ================================================================================
27 
28 namespace enclustra {
29 namespace fpgamanager {
30 
31 // ================================================================================
32 // LE FPGA MANAGER
33 // ================================================================================
34 
38 class FpgaManagerEx : public std::exception
39 {
40  const std::string _errorMsg;
41  const int _errorCode;
42 public:
48  FpgaManagerEx(const std::string& errorMsg = "No error message provided", int errorCode = 0)
49  : _errorMsg(errorMsg), _errorCode(errorCode) {}
53  virtual ~FpgaManagerEx() throw() = default;
58  virtual const char* what() const throw() { return _errorMsg.c_str(); }
63  const std::string& ErrorMsg() const throw() { return _errorMsg; }
68  const int ErrorCode() const throw() { return _errorCode; }
69 };
70 
74 class FpgaManager : public IFpgaManager
75 {
76  struct Impl;
77  Impl* _impl;
78 
79  FpgaManager(const FpgaManager&) = delete;
80  FpgaManager& operator=(const FpgaManager&) = delete;
81 public:
82 
87  explicit FpgaManager(const types::ApiUrl& url);
88 
94  FpgaManager(const types::ApiUrl& url, config::Profile profile);
95 
99  ~FpgaManager();
100 
105  virtual const types::ApiUrl& Url() const override;
106 
111  virtual config::ConfigSettings Config() const override;
112 
117  virtual types::ApiDetails Details() const override;
118 
126  virtual void Configure(const config::ConfigSettings& settings) override;
127 
132  virtual ISystem& SystemApi() override;
133 
144  virtual IMmAccess& CreateMemoryMap(unsigned stream_idx) override;
145 
158  virtual IStream& CreateStream(unsigned stream_idx, StreamType type, StreamDirection direction) override;
159 
163  virtual void Open() override;
164 };
165 
166 // ================================================================================
167 // TRAILER
168 // ================================================================================
169 
170 }
171 }
172 
Interface definition of the FPGA Manager streaming interface
Definition: FpgaManager_Interfaces.h:320
virtual void Open() override
Opens the FPGA Manager connection and creates all primed memory-maps and streams
virtual types::ApiDetails Details() const override
Details of the FPGA Manager libraries
virtual const types::ApiUrl & Url() const override
Getter for API URL
FPGA Manager device URL
Definition: FpgaManager_Types.h:34
const int ErrorCode() const
returns associated error code of the exception
Definition: FpgaManager.h:68
Configuration Parameter
Definition: FpgaManager_Config.h:157
FpgaManagerEx(const std::string &errorMsg="No error message provided", int errorCode=0)
Constructor
Definition: FpgaManager.h:48
Interface definition of the FPGA Manager MmAccess interface
Definition: FpgaManager_Interfaces.h:102
FPGA Manager exceptions
Definition: FpgaManager.h:38
virtual IMmAccess & CreateMemoryMap(unsigned stream_idx) override
Creates an interface for memory mapped access
virtual const char * what() const
returns associated message of the exception
Definition: FpgaManager.h:58
virtual config::ConfigSettings Config() const override
Getter for Configuration
Interface definition for the FPGA Manager System API
Definition: FpgaManager_Interfaces.h:63
Definition: FpgaManager.h:28
Details of the current API
Definition: FpgaManager_Types.h:257
virtual ~FpgaManagerEx()=default
Destructor
virtual void Configure(const config::ConfigSettings &settings) override
Updates the configuration with which all transport instances are configured from
const std::string & ErrorMsg() const
returns associated message of the exception
Definition: FpgaManager.h:63
virtual ISystem & SystemApi() override
Getter for SystemApi interface
virtual IStream & CreateStream(unsigned stream_idx, StreamType type, StreamDirection direction) override
Creates an interface for stream access
Interface definition of the FPGA Manager API
Definition: FpgaManager_Interfaces.h:449