/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Autogenerated by Thrift Compiler (0.10.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
#ifndef BaseAPI_H
#define BaseAPI_H

#include <thrift/TDispatchProcessor.h>
#include <thrift/async/TConcurrentClientSyncInfo.h>
#include "base_api_types.h"

namespace apache { namespace airavata { namespace base { namespace api {

#ifdef _WIN32
  #pragma warning( push )
  #pragma warning (disable : 4250 ) //inheriting methods via dominance 
#endif

class BaseAPIIf {
 public:
  virtual ~BaseAPIIf() {}
  virtual void getAPIVersion(std::string& _return) = 0;
};

class BaseAPIIfFactory {
 public:
  typedef BaseAPIIf Handler;

  virtual ~BaseAPIIfFactory() {}

  virtual BaseAPIIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo) = 0;
  virtual void releaseHandler(BaseAPIIf* /* handler */) = 0;
};

class BaseAPIIfSingletonFactory : virtual public BaseAPIIfFactory {
 public:
  BaseAPIIfSingletonFactory(const boost::shared_ptr<BaseAPIIf>& iface) : iface_(iface) {}
  virtual ~BaseAPIIfSingletonFactory() {}

  virtual BaseAPIIf* getHandler(const ::apache::thrift::TConnectionInfo&) {
    return iface_.get();
  }
  virtual void releaseHandler(BaseAPIIf* /* handler */) {}

 protected:
  boost::shared_ptr<BaseAPIIf> iface_;
};

class BaseAPINull : virtual public BaseAPIIf {
 public:
  virtual ~BaseAPINull() {}
  void getAPIVersion(std::string& /* _return */) {
    return;
  }
};


class BaseAPI_getAPIVersion_args {
 public:

  BaseAPI_getAPIVersion_args(const BaseAPI_getAPIVersion_args&);
  BaseAPI_getAPIVersion_args& operator=(const BaseAPI_getAPIVersion_args&);
  BaseAPI_getAPIVersion_args() {
  }

  virtual ~BaseAPI_getAPIVersion_args() throw();

  bool operator == (const BaseAPI_getAPIVersion_args & /* rhs */) const
  {
    return true;
  }
  bool operator != (const BaseAPI_getAPIVersion_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const BaseAPI_getAPIVersion_args & ) const;

  uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;

};


class BaseAPI_getAPIVersion_pargs {
 public:


  virtual ~BaseAPI_getAPIVersion_pargs() throw();

  uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;

};

typedef struct _BaseAPI_getAPIVersion_result__isset {
  _BaseAPI_getAPIVersion_result__isset() : success(false) {}
  bool success :1;
} _BaseAPI_getAPIVersion_result__isset;

class BaseAPI_getAPIVersion_result {
 public:

  BaseAPI_getAPIVersion_result(const BaseAPI_getAPIVersion_result&);
  BaseAPI_getAPIVersion_result& operator=(const BaseAPI_getAPIVersion_result&);
  BaseAPI_getAPIVersion_result() : success() {
  }

  virtual ~BaseAPI_getAPIVersion_result() throw();
  std::string success;

  _BaseAPI_getAPIVersion_result__isset __isset;

  void __set_success(const std::string& val);

  bool operator == (const BaseAPI_getAPIVersion_result & rhs) const
  {
    if (!(success == rhs.success))
      return false;
    return true;
  }
  bool operator != (const BaseAPI_getAPIVersion_result &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const BaseAPI_getAPIVersion_result & ) const;

  uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;

};

typedef struct _BaseAPI_getAPIVersion_presult__isset {
  _BaseAPI_getAPIVersion_presult__isset() : success(false) {}
  bool success :1;
} _BaseAPI_getAPIVersion_presult__isset;

class BaseAPI_getAPIVersion_presult {
 public:


  virtual ~BaseAPI_getAPIVersion_presult() throw();
  std::string* success;

  _BaseAPI_getAPIVersion_presult__isset __isset;

  uint32_t read(::apache::thrift::protocol::TProtocol* iprot);

};

class BaseAPIClient : virtual public BaseAPIIf {
 public:
  BaseAPIClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) {
    setProtocol(prot);
  }
  BaseAPIClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) {
    setProtocol(iprot,oprot);
  }
 private:
  void setProtocol(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) {
  setProtocol(prot,prot);
  }
  void setProtocol(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) {
    piprot_=iprot;
    poprot_=oprot;
    iprot_ = iprot.get();
    oprot_ = oprot.get();
  }
 public:
  boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() {
    return piprot_;
  }
  boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() {
    return poprot_;
  }
  void getAPIVersion(std::string& _return);
  void send_getAPIVersion();
  void recv_getAPIVersion(std::string& _return);
 protected:
  boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_;
  boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_;
  ::apache::thrift::protocol::TProtocol* iprot_;
  ::apache::thrift::protocol::TProtocol* oprot_;
};

class BaseAPIProcessor : public ::apache::thrift::TDispatchProcessor {
 protected:
  boost::shared_ptr<BaseAPIIf> iface_;
  virtual bool dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext);
 private:
  typedef  void (BaseAPIProcessor::*ProcessFunction)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*);
  typedef std::map<std::string, ProcessFunction> ProcessMap;
  ProcessMap processMap_;
  void process_getAPIVersion(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
 public:
  BaseAPIProcessor(boost::shared_ptr<BaseAPIIf> iface) :
    iface_(iface) {
    processMap_["getAPIVersion"] = &BaseAPIProcessor::process_getAPIVersion;
  }

  virtual ~BaseAPIProcessor() {}
};

class BaseAPIProcessorFactory : public ::apache::thrift::TProcessorFactory {
 public:
  BaseAPIProcessorFactory(const ::boost::shared_ptr< BaseAPIIfFactory >& handlerFactory) :
      handlerFactory_(handlerFactory) {}

  ::boost::shared_ptr< ::apache::thrift::TProcessor > getProcessor(const ::apache::thrift::TConnectionInfo& connInfo);

 protected:
  ::boost::shared_ptr< BaseAPIIfFactory > handlerFactory_;
};

class BaseAPIMultiface : virtual public BaseAPIIf {
 public:
  BaseAPIMultiface(std::vector<boost::shared_ptr<BaseAPIIf> >& ifaces) : ifaces_(ifaces) {
  }
  virtual ~BaseAPIMultiface() {}
 protected:
  std::vector<boost::shared_ptr<BaseAPIIf> > ifaces_;
  BaseAPIMultiface() {}
  void add(boost::shared_ptr<BaseAPIIf> iface) {
    ifaces_.push_back(iface);
  }
 public:
  void getAPIVersion(std::string& _return) {
    size_t sz = ifaces_.size();
    size_t i = 0;
    for (; i < (sz - 1); ++i) {
      ifaces_[i]->getAPIVersion(_return);
    }
    ifaces_[i]->getAPIVersion(_return);
    return;
  }

};

// The 'concurrent' client is a thread safe client that correctly handles
// out of order responses.  It is slower than the regular client, so should
// only be used when you need to share a connection among multiple threads
class BaseAPIConcurrentClient : virtual public BaseAPIIf {
 public:
  BaseAPIConcurrentClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) {
    setProtocol(prot);
  }
  BaseAPIConcurrentClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) {
    setProtocol(iprot,oprot);
  }
 private:
  void setProtocol(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) {
  setProtocol(prot,prot);
  }
  void setProtocol(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) {
    piprot_=iprot;
    poprot_=oprot;
    iprot_ = iprot.get();
    oprot_ = oprot.get();
  }
 public:
  boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() {
    return piprot_;
  }
  boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() {
    return poprot_;
  }
  void getAPIVersion(std::string& _return);
  int32_t send_getAPIVersion();
  void recv_getAPIVersion(std::string& _return, const int32_t seqid);
 protected:
  boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_;
  boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_;
  ::apache::thrift::protocol::TProtocol* iprot_;
  ::apache::thrift::protocol::TProtocol* oprot_;
  ::apache::thrift::async::TConcurrentClientSyncInfo sync_;
};

#ifdef _WIN32
  #pragma warning( pop )
#endif

}}}} // namespace

#endif
