humoto
solution.h
Go to the documentation of this file.
1 /**
2  @file
3  @author Alexander Sherikov
4 
5  @brief
6 */
7 
8 
9 #pragma once
10 
11 
12 namespace humoto
13 {
14  namespace qpmad
15  {
16  /**
17  * @brief Solution of a QP.
18  */
20  {
21  public:
22  /// The return value of qpmad.
23  ::qpmad::Solver::ReturnStatus qpmad_return_value_;
24 
25 
26  public:
27  /**
28  * @brief Status description
29  *
30  * @return description of the status if available
31  */
32  std::string getStatusDescription() const
33  {
34  switch(qpmad_return_value_)
35  {
36  case ::qpmad::Solver::OK:
37  return ("qpmad: Ok.");
38  default:
39  return ("qpmad: Some error.");
40  }
41  }
42 
43 
44  /**
45  * @brief Log a QP problem
46  *
47  * @param[in,out] logger logger
48  * @param[in] parent parent
49  * @param[in] name name
50  */
52  const LogEntryName &parent = LogEntryName(),
53  const std::string &name = "solution") const
54  {
55  LogEntryName subname = parent; subname.add(name);
56 
57  humoto::Solution::log(logger, subname, "");
58 
59  logger.log(LogEntryName(subname).add("qpmad_return_value"), qpmad_return_value_);
60  }
61  };
62  }
63 }
#define HUMOTO_LOCAL
Definition: export_import.h:26
#define HUMOTO_GLOBAL_LOGGER_IF_DEFINED
Definition: logger.h:997
Solution of a QP.
Definition: solution.h:19
Container of the solution.
Definition: solution.h:176
Represents log entry name.
Definition: logger.h:169
void log(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="solution") const
Log a QP problem.
Definition: solution.h:51
Threaded logger: any data sent to this logger is wrapped in a message and pushed to a queue...
Definition: logger.h:555
virtual void log(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="solution") const
Log a QP problem.
Definition: solution.h:351
The root namespace of HuMoTo.
Definition: config.h:12
std::string getStatusDescription() const
Status description.
Definition: solution.h:32
LogEntryName & add(const char *name)
extends entry name with a subname
Definition: logger.h:232
::qpmad::Solver::ReturnStatus qpmad_return_value_
The return value of qpmad.
Definition: solution.h:23