1 #ifndef NOOS_CLOUD_CALLABLE 2 #define NOOS_CLOUD_CALLABLE 6 #include "includes.ihh" 7 #include <noos/cloud/asio/platform.hpp> 8 #include <noos/cloud/default_error_handler.hpp> 9 #include <noos/cloud/asio/asio_https.hpp> 10 #include <noos/cloud/asio/asio_http.hpp> 11 #include <noos/cloud/asio/platform.hpp> 12 #include <noos/cloud/cloud_base.hpp> 13 #include <noos/cloud/deserialize.hpp> 14 #include <noos/cloud/vision_batch.hpp> 26 template <
class cloud_type,
27 bool keep_alive =
true,
33 using callback =
typename cloud_type::callback;
34 using cloud_class = cloud_type;
62 template <
typename... parameters,
63 typename =
typename std::enable_if<!std::is_same<cloud_type,cloud_batch>::value,
bool>>
70 template <
typename... parameters>
75 template <
typename... parameters,
76 typename =
typename std::enable_if<std::is_same<cloud_type,cloud_batch>::value,
bool>>
83 void send(
unsigned int timeout = 2);
88 void socket(std::function<
void(std::string)> cloud_function);
92 std::unique_ptr<socket_type> socket_;
93 std::unique_ptr<boost::asio::streambuf> buffer_;
94 std::unique_ptr<boost::asio::ip::tcp::resolver::query> query_;
95 std::unique_ptr<boost::asio::io_service> io_;
96 std::unique_ptr<boost::asio::ip::tcp::resolver> resol_;
99 template <
class cloud_type,
100 bool keep_alive =
true,
105 typename std::enable_if<!std::is_same<cloud_type,
108 call(
typename cloud_type::callback functor,
117 #include "callable.tpl" void stop()
stop calls and shutdown socket
Definition: callable.hpp:163
void send(unsigned int timeout=2)
send the cloud_type data once to the cloud endpoint
Definition: callable.hpp:138
a class which wraps around a cloud call, its socket, buffer and callback
Definition: callable.hpp:30
cloud service batch class
Definition: cloud_base.hpp:49
Definition: asio_handler.hpp:14
callable(vision_batch< parameters... > arg, platform=default_node)
overloaded constructor for vision_batch template cloud_type
Definition: callable.hpp:71
default error handler will output on stderr
Definition: default_error_handler.hpp:19
class which wraps around raw bytes of a picture
Definition: picture.hpp:17
vision_batch
Definition: vision_batch.hpp:44
callable & operator=(const callable &)=delete
callable(callback functor, platform info, parameters...args)
construct a callable object wrapper
Definition: callable.hpp:41
callable()=delete
no empty constructor allowed
cloud_type object
Definition: callable.hpp:38
ASIO socket controller for TLS (encrypred) cloud service calls.
Definition: asio_https.hpp:23
const platform default_node
default platform where to connect
Definition: platform.hpp:43