alb_curl_helper.h
Go to the documentation of this file.
1 #ifndef _ALB_CURL_HELPER_H
2 #define _ALB_CURL_HELPER_H
3 
4 // curl headers
5 #include <curl/curl.h>
6 
7 // Standard headers
8 #include <string>
9 
10 // Local headers
11 #include "outsight_alb_driver/AlbConfig.h"
12 #include "outsight_alb_driver/AlbFile.h"
13 
16  public:
19  Restart = 0,
22  };
23 
25  enum processing_config_e { Get = 0, Put };
26 
29  Download = 0,
32  };
33 
34  public:
35  AlbCurlHelper(const std::string &ip_address);
36  ~AlbCurlHelper(void);
37 
39  const std::string getErrorMessage(void) const;
40 
45  bool executeProcessing(const processing_service_e service);
46 
52  bool isProcessingRunning(bool &running);
53 
58  bool executeProcessingConfig(const processing_config_e &service,
59  outsight_alb_driver::AlbConfig::Request &request);
60 
65  bool executeProcessingZones(std::string &zones);
66 
71  bool executeStorage(const storage_service_e service, outsight_alb_driver::AlbFile::Request &request);
72 
73  private:
78  bool initCurl(void);
79 
81  void defineBaseCommand(const std::string &alb_command);
82 
87  bool defineProcessingConfig(const processing_config_e &service,
88  outsight_alb_driver::AlbConfig::Request &request);
89 
94  bool defineStorageCommand(const storage_service_e service, outsight_alb_driver::AlbFile::Request &request);
95 
100  bool executeCurlCommand(const std::string &command);
101 
106  bool exportData(const std::string &data, const std::string &output_path,
107  const std::string &print_text = std::string("Print data:"));
108 
110  const std::string readData(const std::string &filepath);
111 
113  bool defineStorageListCommand(const outsight_alb_driver::AlbFile::Request &request);
114 
115  protected:
116  CURL *curl;
117  struct curl_slist *chunk;
119 
120  std::string curl_address;
121  std::string callback_data;
122  std::string error_message;
123 
124  FILE *file;
125 };
126 
127 #endif // _ALB_CURL_HELPER_H
processing_config_e
Processing configuration services.
bool defineStorageCommand(const storage_service_e service, outsight_alb_driver::AlbFile::Request &request)
Define the storage command.
bool initCurl(void)
Initialize the curl command.
bool isProcessingRunning(bool &running)
Check if processing is running.
processing_service_e
Processing services of the ALB.
AlbCurlHelper(const std::string &ip_address)
bool defineProcessingConfig(const processing_config_e &service, outsight_alb_driver::AlbConfig::Request &request)
Define the processing configuration command.
void defineBaseCommand(const std::string &alb_command)
Define base curl command for the ALB.
std::string error_message
std::string callback_data
bool defineStorageListCommand(const outsight_alb_driver::AlbFile::Request &request)
Define the command to list storage files.
bool executeProcessingConfig(const processing_config_e &service, outsight_alb_driver::AlbConfig::Request &request)
Execute the processing command for the configuration.
bool executeProcessing(const processing_service_e service)
Execute the processing command.
storage_service_e
Storage services.
struct curl_slist * chunk
const std::string getErrorMessage(void) const
Get the error message.
bool exportData(const std::string &data, const std::string &output_path, const std::string &print_text=std::string("Print data:"))
Export the data to the output filepath.
Class to handle the curl ALB requests.
std::string curl_address
bool executeStorage(const storage_service_e service, outsight_alb_driver::AlbFile::Request &request)
Execute the storage command.
bool executeCurlCommand(const std::string &command)
Execute the curl command.
bool executeProcessingZones(std::string &zones)
Execute the processing command for the zones.
const std::string readData(const std::string &filepath)
Read data from the input filepath.


outsight_alb_driver
Author(s): Outsight
autogenerated on Fri Oct 14 2022 02:29:51