SMACC2
Loading...
Searching...
No Matches
cb_http_request.hpp
Go to the documentation of this file.
1// Copyright 2023 RobosoftAI Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15/*****************************************************************************************************************
16 *
17 * Authors: Jaycee Lock
18 *
19 ******************************************************************************************************************/
20
21#pragma once
22
23#include <cstring>
25#include <smacc2/smacc.hpp>
26
27namespace cl_http
28{
29
31{
32public:
34 : kRequestType(http_request_type)
35 {
36 }
37
38 template <typename TOrthogonal, typename TSourceObject>
39 [[deprecated(
40 "Use onStateOrthogonalAllocation instead. onOrthogonalAllocation will be removed in future "
41 "versions.")]] void
45
46 template <typename TOrthogonal, typename TSourceObject>
48 {
49 // Base implementation - can be overridden by derived classes
50 }
51
57
58 virtual void onResponseReceived(const ClHttp::TResponse & response) {}
59
60 virtual void onEntry() override { cl_http_->makeRequest(kRequestType); }
61
62 virtual void onExit() override {}
63
64private:
66
68};
69} // namespace cl_http
CbHttpRequestBase(const ClHttp::kHttpRequestMethod http_request_type)
virtual void onEntry() override
virtual void onExit() override
virtual void runtimeConfigure() override
const ClHttp::kHttpRequestMethod kRequestType
virtual void onResponseReceived(const ClHttp::TResponse &response)
void makeRequest(const kHttpRequestMethod http_method, const std::string &path="/", const std::string &body="", const std::unordered_map< std::string, std::string > &headers={})
http_session_base::TResponse TResponse
boost::signals2::connection onResponseReceived(void(T::*callback)(const TResponse &), T *object)
void requiresClient(SmaccClientType *&storage)