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

// generated from struct_header.h
#ifndef GITAPPLYOPTIONS_H
#define GITAPPLYOPTIONS_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 "../include/diff_delta.h"
  #include "../include/diff_hunk.h"
 
using namespace node;
using namespace v8;

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

  static std::string className() { return "GitApplyOptions"; };
  static const bool isSingleton = false;
  static const bool isFreeable = false;
  static void free(git_apply_options *raw) {
     Nan::ThrowError("free called on GitApplyOptions which cannot be freed");
   }
};
  
class ConfigurableGitApplyOptions : public nodegit::ConfigurableClassWrapper<GitApplyOptionsTraits> {
  friend class nodegit::ConfigurableClassWrapper<GitApplyOptionsTraits>;

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

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

          static int deltaCb_cppCallback (
            const git_diff_delta * delta
              ,
             void * payload
          );

        static void deltaCb_cancelAsync(void *baton);
        static void deltaCb_async(void *baton);
        static void deltaCb_promiseCompleted(bool isFulfilled, nodegit::AsyncBaton *_baton, v8::Local<v8::Value> result);
           class DeltaCbBaton : public nodegit::AsyncBatonWithResult<int> {
          public:
              const git_diff_delta * delta;
              void * payload;
 
            DeltaCbBaton(const int &defaultResult)
              : nodegit::AsyncBatonWithResult<int>(defaultResult) {
              }
          };
         static ConfigurableGitApplyOptions * deltaCb_getInstanceFromBaton (
          DeltaCbBaton *baton);
          static int hunkCb_cppCallback (
            const git_diff_hunk * hunk
              ,
             void * payload
          );

        static void hunkCb_cancelAsync(void *baton);
        static void hunkCb_async(void *baton);
        static void hunkCb_promiseCompleted(bool isFulfilled, nodegit::AsyncBaton *_baton, v8::Local<v8::Value> result);
           class HunkCbBaton : public nodegit::AsyncBatonWithResult<int> {
          public:
              const git_diff_hunk * hunk;
              void * payload;
 
            HunkCbBaton(const int &defaultResult)
              : nodegit::AsyncBatonWithResult<int>(defaultResult) {
              }
          };
         static ConfigurableGitApplyOptions * hunkCb_getInstanceFromBaton (
          HunkCbBaton *baton);
     
private:
  ConfigurableGitApplyOptions(nodegit::Context *nodegitContext);
  ConfigurableGitApplyOptions() = delete;
  Nan::Global<Value> promiseError;

             CallbackWrapper deltaCb;
             CallbackWrapper hunkCb;
       
};

#endif
