util/qos/Query.cpp

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------------
00002 Name:      Query.cpp
00003 Project:   xmlBlaster.org
00004 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
00005 Comment:   Holding a query string and a prepared query object. 
00006 ------------------------------------------------------------------------------*/
00007 
00015 # include <util/qos/Query.h>
00016 #include <util/Global.h>
00017 
00018 using namespace std;
00019 
00020 namespace org { namespace xmlBlaster { namespace util { namespace qos {
00021 
00022 Query::Query(Global& global, const string& query)
00023    : ME("Query"), global_(global)
00024 {
00025    query_ = query;
00026    preparedQuery_ = NULL;
00027 }
00028 
00029 Query::Query(const Query& query)
00030    : ME(query.ME), global_(query.global_)
00031 {
00032    preparedQuery_ = query.preparedQuery_;
00033    query_         = query.query_;
00034 }
00035 
00036 Query& Query::operator =(const Query& query)
00037 {
00038    preparedQuery_ = query.preparedQuery_;
00039    query_         = query.query_;
00040    return *this;
00041 }
00042  
00043 string Query::getQuery()
00044 {
00045    return query_;
00046 }
00047 
00048 void Query::setPreparedQuery(void* preparedQuery, size_t /*size*/)
00049 {
00050    // here a copy should be done ...
00051    preparedQuery_ = preparedQuery;
00052 }
00053 
00054 void* Query::getPreparedQuery()
00055 {
00056    return preparedQuery_;
00057 }
00058 
00059 string Query::toString()
00060 {
00061    return query_;
00062 }
00063 
00064 }}}} // namespace
00065 
00066 
00067