Turi Create  4.0
dispatch.hpp
1 /* Copyright © 2017 Apple Inc. All rights reserved.
2  *
3  * Use of this source code is governed by a BSD-3-clause license that can
4  * be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
5  */
6 #ifndef CPPIPC_SERVER_DISPATCH_HPP
7 #define CPPIPC_SERVER_DISPATCH_HPP
8 #include <core/storage/serialization/serialization_includes.hpp>
9 
10 namespace cppipc {
11 class comm_server;
12 /**
13  * \internal
14  * \ingroup cppipc
15  * The base class for the function dispatch object.
16  * The function dispatch object wraps a member function pointer and the
17  * execute call then calls the member function pointer using the objectptr as
18  * the object, and the remaining arguments are deserialized from the iarchive.
19  * The result of the call are serialized in the response archive.
20  *
21  * The restrictions are the the function call must not take any
22  * arguments by reference.
23  */
24 struct dispatch {
25  virtual void execute(void* objectptr,
26  comm_server* server,
27  turi::iarchive& msg,
28  turi::oarchive& response) = 0;
29  virtual ~dispatch() { }
30 };
31 
32 
33 
34 
35 
36 } // cppipc
37 
38 #endif
The serialization input archive object which, provided with a reference to an istream, will read from the istream, providing deserialization capabilities.
Definition: iarchive.hpp:60
The serialization output archive object which, provided with a reference to an ostream, will write to the ostream, providing serialization capabilities.
Definition: oarchive.hpp:80