/* * =============================================================== * Description: Client busybee wrapper. * * Created: 2014-07-02 15:58:10 * * Author: Ayush Dubey, dubey@cs.cornell.edu * * Copyright (C) 2013, Cornell University, see the LICENSE file * for licensing agreement * =============================================================== */ #ifndef weaver_client_comm_wrapper_h_ #define weaver_client_comm_wrapper_h_ #include #include #include #include #include "common/configuration.h" namespace cl { class comm_wrapper { public: class weaver_mapper : public busybee_mapper { private: std::unordered_map mlist; public: weaver_mapper(const configuration &config); virtual ~weaver_mapper() throw () { } virtual bool lookup(uint64_t server_id, po6::net::location *loc); private: weaver_mapper(const weaver_mapper&); weaver_mapper& operator=(const weaver_mapper&); }; private: configuration config; std::unique_ptr wmap; std::unique_ptr bb; uint64_t bb_id; uint64_t recv_from; public: comm_wrapper(uint64_t bb_id, const configuration &config); ~comm_wrapper(); void reconfigure(const configuration &new_config); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" busybee_returncode send(uint64_t send_to, std::auto_ptr msg); busybee_returncode recv(std::auto_ptr *msg); #pragma GCC diagnostic pop void drop(); }; } #endif