CYNQ  0.3.0
Framework to develop FPGA applications in C++ with the easiness of PYNQ
status.hpp
1 /*
2  * See LICENSE for more information about licensing
3  *
4  * Copyright 2023
5  * Author: Luis G. Leon-Vega <luis.leon@ieee.org>
6  * Diego Arturo Avila Torres <diego.avila@uned.cr>
7  *
8  */
9 #pragma once
10 
11 #include <string>
12 
13 namespace cynq {
19 struct Status {
21  enum {
22  OK = 0,
28  CONFIGURATION_ERROR,
35  };
36 
37  int code;
38  int retval;
39  std::string msg;
46  Status() noexcept : code{0}, retval{0} {}
47 
56  Status(const int code, const std::string &msg) noexcept
57  : code{code}, retval{0}, msg{msg} {}
58 
68  Status(const int code, const int retval, const std::string &msg) noexcept
69  : code{code}, retval{retval}, msg{msg} {}
70 };
71 } // namespace cynq
Structure to define the return characteristics of each function.
Definition: status.hpp:19
Status() noexcept
Construct a new Status object.
Definition: status.hpp:46
int retval
Definition: status.hpp:38
@ NOT_IMPLEMENTED
Definition: status.hpp:30
@ MEMBER_ABSENT
Definition: status.hpp:31
@ FILE_ERROR
Definition: status.hpp:23
@ INCOMPATIBLE_PARAMETER
Definition: status.hpp:27
@ EXECUTION_FAILED
Definition: status.hpp:33
@ REGISTER_IO_ERROR
Definition: status.hpp:29
@ REGISTER_NOT_ALIGNED
Definition: status.hpp:34
@ INVALID_PARAMETER
Definition: status.hpp:24
@ RESOURCE_BUSY
Definition: status.hpp:32
std::string msg
Definition: status.hpp:39
Status(const int code, const int retval, const std::string &msg) noexcept
Construct a new Status object.
Definition: status.hpp:68
Status(const int code, const std::string &msg) noexcept
Construct a new Status object.
Definition: status.hpp:56