Drizzled Public API Documentation

protocol.h
00001 /* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2010 Brian Aker
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019  */
00020 
00021 
00022 #pragma once
00023 
00024 #include <drizzled/plugin/listen_tcp.h>
00025 #include <drizzled/plugin/client.h>
00026 #include <drizzled/atomics.h>
00027 #include <drizzled/plugin/table_function.h>
00028 #include <boost/filesystem.hpp>
00029 #include <plugin/mysql_protocol/mysql_protocol.h>
00030 
00031 namespace drizzle_plugin {
00032 namespace mysql_unix_socket_protocol {
00033 
00034 class Protocol : public ListenMySQLProtocol
00035 {
00036 public:
00037   Protocol(std::string name, const boost::filesystem::path &unix_socket_path) :
00038     ListenMySQLProtocol(name, unix_socket_path.file_string()), 
00039     _unix_socket_path(unix_socket_path)
00040   { }
00041 
00042   ~Protocol();
00043   bool getFileDescriptors(std::vector<int> &fds);
00044 
00045   in_port_t getPort(void) const;
00046   static ProtocolCounters mysql_unix_counters;
00047   virtual ProtocolCounters& getCounters() const {return mysql_unix_counters; }
00048   drizzled::plugin::Client *getClient(int fd);
00049 private:
00050   const boost::filesystem::path _unix_socket_path;
00051 };
00052 
00053 } /* namespace mysql_unix_socket_protocol */
00054 } /* namespace drizzle_plugin */
00055