CommunicationFileFormat.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * @brief Defines the communication file format
  3. * @file aman/config/CommunicationFileFormat.h
  4. * @author Sven Czarnian <devel@svcz.de>
  5. * @copyright Copyright 2021 Sven Czarnian
  6. * @license This project is published under the GNU General Public License v3 (GPLv3)
  7. */
  8. #pragma once
  9. #include <aman/config/FileFormat.h>
  10. #include <aman/types/Communication.h>
  11. namespace aman {
  12. /**
  13. * @brief Defines the parser of communication configurations
  14. * @ingroup format
  15. *
  16. * All configuration entries need to be stored in 'AmanCommunication.txt'.
  17. *
  18. * The following entries of the configuration exist:
  19. * <table>
  20. * <caption id="multi_row">Setting entries</caption>
  21. * <tr>
  22. * <th>Name</th><th>Description</th><th>Default value</th><th>Unit</th>
  23. * </tr>
  24. * <tr>
  25. * <td>URL</td>
  26. * <td>Defines the URL to the backend.</td>
  27. * <td></td><td></td>
  28. * </tr>
  29. * <tr>
  30. * <td>Port</td>
  31. * <td>Defines the port to access the backend.</td>
  32. * <td></td><td></td>
  33. * </tr>
  34. * <tr>
  35. * <td>UID</td>
  36. * <td>Defines the identifier to access the backend.</td>
  37. * <td></td><td></td>
  38. * </tr>
  39. * </table>
  40. */
  41. class CommunicationFileFormat : public FileFormat {
  42. #ifndef DOXYGEN_IGNORE
  43. public:
  44. /**
  45. * @brief Initializes the communication file format
  46. */
  47. CommunicationFileFormat();
  48. /**
  49. * @brief Parses the set configuration file
  50. * @param[in] filename The path to the configuration file
  51. * @param[out] config The resulting configuration
  52. * @return True if the configuration file was valid, else false
  53. */
  54. bool parse(const std::string& filename, Communication& config);
  55. #endif
  56. };
  57. }