LogCabin
|
00001 /* Copyright (c) 2012 Stanford University 00002 * 00003 * Permission to use, copy, modify, and distribute this software for any 00004 * purpose with or without fee is hereby granted, provided that the above 00005 * copyright notice and this permission notice appear in all copies. 00006 * 00007 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR(S) DISCLAIM ALL WARRANTIES 00008 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 00009 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL AUTHORS BE LIABLE FOR 00010 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 00011 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 00012 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 00013 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 00014 */ 00015 00016 #include "build/Protocol/Client.pb.h" 00017 #include "Tree/Tree.h" 00018 00019 #ifndef LOGCABIN_TREE_PROTOBUF_H 00020 #define LOGCABIN_TREE_PROTOBUF_H 00021 00022 namespace LogCabin { 00023 namespace Tree { 00024 namespace ProtoBuf { 00025 00026 /** 00027 * Respond to a read-only request to query a Tree. 00028 */ 00029 void 00030 readOnlyTreeRPC(const Tree& tree, 00031 const Protocol::Client::ReadOnlyTree::Request& request, 00032 Protocol::Client::ReadOnlyTree::Response& response); 00033 00034 /** 00035 * Respond to a read-write operation on a Tree. 00036 */ 00037 void 00038 readWriteTreeRPC(Tree& tree, 00039 const Protocol::Client::ReadWriteTree::Request& request, 00040 Protocol::Client::ReadWriteTree::Response& response); 00041 00042 } // namespace LogCabin::Tree::ProtoBuf 00043 } // namespace LogCabin::Tree 00044 } // namespace LogCabin 00045 00046 #endif // LOGCABIN_TREE_PROTOBUF_H