Drizzled Public API Documentation

thread_context.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 Vijay Samuel
00005  *  Copyright (C) 2008 MySQL
00006  *
00007  *  This program is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; either version 2 of the License, or
00010  *  (at your option) any later version.
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 "client_priv.h"
00025 #include "statement.h"
00026 #include <string>
00027 #include <iosfwd>
00028 
00029 class ThreadContext 
00030 {
00031 public:
00032   ThreadContext(Statement *in_stmt,
00033                 uint64_t in_limit) :
00034     stmt(in_stmt),
00035     limit(in_limit)
00036   { }
00037 
00038   ThreadContext() :
00039     stmt(),
00040     limit(0)
00041   { }
00042 
00043   Statement *getStmt() const
00044   {
00045     return stmt;
00046   }
00047 
00048   uint64_t getLimit() const
00049   {
00050     return limit;
00051   }
00052 
00053   void setStmt(Statement *in_stmt)
00054   {
00055     stmt= in_stmt;
00056   }
00057 
00058   void setLimit(uint64_t in_limit)
00059   {
00060     limit= in_limit;
00061   }  
00062 
00063 private:
00064   Statement *stmt;
00065   uint64_t limit;
00066 };