16 #ifndef __SSRC_WISP_TEST_SERVICE_TEST_CASE_H
17 #define __SSRC_WISP_TEST_SERVICE_TEST_CASE_H
28 using NS_SSRC_WISP_SERVICE::ServiceEventHandler;
29 using NS_SSRC_WISP_SERVICE::Service;
32 template<
typename ProtocolProcessor,
33 template <
typename PP,
typename...>
class EH = ServiceEventHandler>
35 typedef Service<EH<ProtocolProcessor> > super;
40 const std::string & name =
"",
41 const unsigned int message_capacity =
42 NS_SSRC_SPREAD::Message::DefaultCapacity) :
43 super(connection, name, message_capacity)
46 template<
typename Initializer>
48 const std::string & connection =
"",
49 const std::string & name =
"",
50 const unsigned int message_capacity =
51 NS_SSRC_SPREAD::Message::DefaultCapacity) :
52 super(initializer, connection, name, message_capacity)
55 using super::protocol;
59 template<
typename service_type,
typename CallStop>
61 typedef typename service_type::caller_type
super;
73 super(WISP_SPREAD_DAEMON),
76 serv.start(*loop, 300);
78 thread_ptr(make_smart_ptr<thread_ptr>(std::bind(&loop_type::start,
80 while(serv.state() != protocol_processor::Started) {
81 std::this_thread::yield();
86 super::template send<CallStop>(serv.name());
97 connection(WISP_SPREAD_DAEMON), name(),
98 capacity(NS_SSRC_SPREAD::Message::DefaultCapacity)
102 template<
typename ProtocolProcessor,
104 template <
typename PP,
typename...>
class EH = ServiceEventHandler,
106 bool has_initializer =
false>
114 utility::ServiceFactory<service_type, Options, has_initializer>
119 typename service_factory::service_ptr
serv;