Drizzled Public API Documentation

scheduler.h
00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Definitions required for Configuration Variables plugin
00005  *
00006  *  Copyright (C) 2008 Sun Microsystems, Inc.
00007  *
00008  *  This program is free software; you can redistribute it and/or modify
00009  *  it under the terms of the GNU General Public License as published by
00010  *  the Free Software Foundation; version 2 of the License.
00011  *
00012  *  This program is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with this program; if not, write to the Free Software
00019  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020  */
00021 
00022 #pragma once
00023 
00024 #include <drizzled/plugin/plugin.h>
00025 #include <drizzled/session.h>
00026 
00027 #include <string>
00028 #include <vector>
00029 
00030 #include <drizzled/visibility.h>
00031 
00032 namespace drizzled
00033 {
00034 
00035 class Session;
00036 
00037 namespace plugin
00038 {
00039 
00044 class DRIZZLED_API Scheduler : public Plugin
00045 {
00046   /* Disable default constructors */
00047   Scheduler();
00048   Scheduler(const Scheduler &);
00049   Scheduler& operator=(const Scheduler &);
00050 public:
00051   explicit Scheduler(std::string name_arg)
00052     : Plugin(name_arg, "Scheduler")
00053   {}
00054   virtual ~Scheduler() {}
00055 
00060   virtual bool addSession(Session::shared_ptr &session)= 0;
00061 
00065   virtual void killSession(Session *) {}
00066 
00070   virtual void killSessionNow(Session::shared_ptr&) {}
00071 
00072   static bool addPlugin(plugin::Scheduler *sced);
00073   static void removePlugin(plugin::Scheduler *sced);
00074   static bool setPlugin(const std::string& name);
00075   static Scheduler *getScheduler();
00076 };
00077 
00078 } /* namespace plugin */
00079 } /* namespace drizzled */
00080