// This is a generated file, modify: generate/templates/templates/struct_header.h

// generated from struct_header.h
#ifndef GITCHECKOUTOPTIONS_H
#define GITCHECKOUTOPTIONS_H
#include <nan.h>
#include <string>
#include <utility>

#include "async_baton.h"
#include "async_worker.h"
#include "callback_wrapper.h"
#include "context.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
#include "configurable_class_wrapper.h"
#include "v8_helpers.h"

extern "C" {
  #include <git2.h>
  #include <git2/sys/errors.h>
 }

  #include "../include/diff_file.h"
  #include "../include/strarray.h"
  #include "../include/tree.h"
  #include "../include/index.h"
  #include "../include/checkout_perfdata.h"
 
using namespace node;
using namespace v8;

class GitCheckoutOptions;
class ConfigurableGitCheckoutOptions;
 
struct GitCheckoutOptionsTraits {
  typedef GitCheckoutOptions cppClass;
  typedef git_checkout_options cType;
  typedef ConfigurableGitCheckoutOptions configurableCppClass;
 
  static const bool isDuplicable = false;
  static void duplicate(git_checkout_options **dest, git_checkout_options *src) {
     Nan::ThrowError("duplicate called on GitCheckoutOptions which cannot be duplicated");
   }

  static std::string className() { return "GitCheckoutOptions"; };
  static const bool isSingleton = false;
  static const bool isFreeable = true;
  static void free(git_checkout_options *raw) {
    unsigned long referenceCount = 0;
     if (referenceCount == 0) {
      ::free(raw); // :: to avoid calling this free recursively
    }
   }
};
  
class ConfigurableGitCheckoutOptions : public nodegit::ConfigurableClassWrapper<GitCheckoutOptionsTraits> {
  friend class nodegit::ConfigurableClassWrapper<GitCheckoutOptionsTraits>;

public:
  static v8ConversionResult fromJavascript(nodegit::Context *nodegitContext, v8::Local<v8::Value> input);
  ~ConfigurableGitCheckoutOptions();

  ConfigurableGitCheckoutOptions(const ConfigurableGitCheckoutOptions &) = delete;
  ConfigurableGitCheckoutOptions(ConfigurableGitCheckoutOptions &&) = delete;
  ConfigurableGitCheckoutOptions &operator=(const ConfigurableGitCheckoutOptions &) = delete;
  ConfigurableGitCheckoutOptions &operator=(ConfigurableGitCheckoutOptions &&) = delete;

                      static int notifyCb_cppCallback (
            git_checkout_notify_t why
              ,
             const char * path
              ,
             const git_diff_file * baseline
              ,
             const git_diff_file * target
              ,
             const git_diff_file * workdir
              ,
             void * payload
          );

        static void notifyCb_cancelAsync(void *baton);
        static void notifyCb_async(void *baton);
        static void notifyCb_promiseCompleted(bool isFulfilled, nodegit::AsyncBaton *_baton, v8::Local<v8::Value> result);
           class NotifyCbBaton : public nodegit::AsyncBatonWithResult<int> {
          public:
              git_checkout_notify_t why;
              const char * path;
              const git_diff_file * baseline;
              const git_diff_file * target;
              const git_diff_file * workdir;
              void * payload;
 
            NotifyCbBaton(const int &defaultResult)
              : nodegit::AsyncBatonWithResult<int>(defaultResult) {
              }
          };
         static ConfigurableGitCheckoutOptions * notifyCb_getInstanceFromBaton (
          NotifyCbBaton *baton);
            static void progressCb_cppCallback (
            const char * path
              ,
             size_t completed_steps
              ,
             size_t total_steps
              ,
             void * payload
          );

        static void progressCb_cancelAsync(void *baton);
        static void progressCb_async(void *baton);
        static void progressCb_promiseCompleted(bool isFulfilled, nodegit::AsyncBaton *_baton, v8::Local<v8::Value> result);
          class ProgressCbBaton : public nodegit::AsyncBatonWithNoResult {
          public:
              const char * path;
              size_t completed_steps;
              size_t total_steps;
              void * payload;
 
            ProgressCbBaton()
              : nodegit::AsyncBatonWithNoResult() {
              }
          };
         static ConfigurableGitCheckoutOptions * progressCb_getInstanceFromBaton (
          ProgressCbBaton *baton);
                          static void perfdataCb_cppCallback (
            const git_checkout_perfdata * perfdata
              ,
             void * payload
          );

        static void perfdataCb_cancelAsync(void *baton);
        static void perfdataCb_async(void *baton);
        static void perfdataCb_promiseCompleted(bool isFulfilled, nodegit::AsyncBaton *_baton, v8::Local<v8::Value> result);
          class PerfdataCbBaton : public nodegit::AsyncBatonWithNoResult {
          public:
              const git_checkout_perfdata * perfdata;
              void * payload;
 
            PerfdataCbBaton()
              : nodegit::AsyncBatonWithNoResult() {
              }
          };
         static ConfigurableGitCheckoutOptions * perfdataCb_getInstanceFromBaton (
          PerfdataCbBaton *baton);
       
private:
  ConfigurableGitCheckoutOptions(nodegit::Context *nodegitContext);
  ConfigurableGitCheckoutOptions() = delete;
  Nan::Global<Value> promiseError;

                               CallbackWrapper notifyCb;
                CallbackWrapper progressCb;
                       Nan::Global<Object> baseline;
                 Nan::Global<Object> baselineIndex;
                          CallbackWrapper perfdataCb;
           
};

#endif
