#ifndef TRANSACTION_H
#define TRANSACTION_H

#include <nan.h>
#include "agent.h"
#include "nodeagent.h"

using namespace v8;

class Transaction : public Nan::ObjectWrap {
public:
   Transaction(libagent_Transaction *ref, Libagent *libagent);

   static NAN_MODULE_INIT(Init);
   static Local<Value> Start(Agent *agent, const char *uuid);

private:
   ~Transaction();

   static NAN_GETTER(Uuid);
   static NAN_METHOD(CreateArray);
   static NAN_METHOD(CreateMap);
   static NAN_METHOD(RunHook);
   static NAN_METHOD(HasHook);
   static NAN_METHOD(HookRan);
   static NAN_METHOD(Finish);
   static NAN_METHOD(StartTimer);

   static Nan::Persistent<Function> constructor;
   libagent_Transaction *ref;
   Libagent *libagent;

   friend class Table;
   friend class Timer;
};
#endif
