24 #ifndef DC_INTERNAL_TYPES_HPP
25 #define DC_INTERNAL_TYPES_HPP
26 #include <boost/function.hpp>
27 #include <boost/unordered_map.hpp>
28 #include <graphlab/rpc/dc_types.hpp>
29 #include <graphlab/util/resizing_array_sink.hpp>
30 #include <graphlab/parallel/pthread_tools.hpp>
31 #include <graphlab/serialization/serialization_includes.hpp>
33 class distributed_control;
42 typedef void (*comm_recv_callback_type)(
void* tag,
procid_t src,
43 const char* buf,
size_t len);
51 typedef void (*dispatch_type)(distributed_control& dc,
procid_t,
unsigned char,
const char* data,
size_t len);
61 typedef void (*dispatch_type2)(distributed_control& dc,
procid_t,
unsigned char,
const char* data,
size_t len);
64 typedef boost::unordered_map<std::string, dispatch_type> dispatch_map_type;
67 const size_t COMM_STREAM = 1;
68 const size_t COMM_DATAGRAM = 0;
77 unsigned char packet_type_mask;
78 unsigned char sequentialization_key;
81 typedef uint32_t block_header_type;
91 inline void charstring_free(T& t) { }
98 inline void charstring_free<char*>(
char* &c){
104 #define REQUEST_WAIT_METHOD 1
112 struct recv_from_struct {
113 inline recv_from_struct():tag(0), hasdata(false) { }
128 struct terminator_token {
129 terminator_token():calls_sent(0),calls_recv(0),terminate(false) { }
130 terminator_token(
size_t sent,
size_t recv):calls_sent(sent),
131 calls_recv(recv),terminate(false) { }
141 SERIALIZABLE_POD(graphlab::dc_impl::terminator_token);