// This is a generated file, modify: generate/templates/templates/class_header.h #ifndef GITREFDB_H #define GITREFDB_H #include #include #include #include #include #include #include "async_baton.h" #include "nodegit_wrapper.h" #include "promise_completion.h" #include "reference_counter.h" extern "C" { #include } #include "../include/typedefs.h" #include "../include/repository.h" // Forward declaration. struct git_refdb { }; using namespace node; using namespace v8; class GitRefdb; struct GitRefdbTraits { typedef GitRefdb cppClass; typedef git_refdb cType; static const bool isDuplicable = false; static void duplicate(git_refdb **dest, git_refdb *src) { Nan::ThrowError("duplicate called on GitRefdb which cannot be duplicated"); } static const bool isSingleton = false; static const bool isFreeable = true; static void free(git_refdb *raw) { unsigned long referenceCount = 0; if (referenceCount == 0) { ::git_refdb_free(raw); // :: to avoid calling this free recursively } } }; class GitRefdb : public NodeGitWrapper { // grant full access to base class friend class NodeGitWrapper; public: static void InitializeComponent (v8::Local target); private: GitRefdb() : NodeGitWrapper( "A new GitRefdb cannot be instantiated." ) {} GitRefdb(git_refdb *raw, bool selfFreeing, v8::Local owner = v8::Local()) : NodeGitWrapper(raw, selfFreeing, owner) {} ~GitRefdb(); static NAN_METHOD(Compress); struct OpenBaton { int error_code; const git_error* error; git_refdb * out; git_repository * repo; }; class OpenWorker : public Nan::AsyncWorker { public: OpenWorker( OpenBaton *_baton, Nan::Callback *callback ) : Nan::AsyncWorker(callback) , baton(_baton) {}; ~OpenWorker() {}; void Execute(); void HandleOKCallback(); private: OpenBaton *baton; }; static NAN_METHOD(Open); }; #endif