Changing Closure API. No need for so many pointers...
diff --git a/ccnx/ccnx-closure.h b/ccnx/ccnx-closure.h
index 1bcaa06..39fbc16 100644
--- a/ccnx/ccnx-closure.h
+++ b/ccnx/ccnx-closure.h
@@ -1,11 +1,30 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2013 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ * Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
#ifndef CCNX_CLOSURE_H
#define CCNX_CLOSURE_H
#include "ccnx-common.h"
#include "ccnx-name.h"
-using namespace std;
-
namespace Ccnx {
class Closure
@@ -22,10 +41,11 @@
typedef boost::function<TimeoutCallbackReturnValue (const Name &)> TimeoutCallback;
Closure(const DataCallback &dataCallback, const TimeoutCallback &timeoutCallback = TimeoutCallback());
- Closure(const Closure &other);
virtual ~Closure();
+
virtual void
runDataCallback(const Name &name, const Bytes &content);
+
virtual TimeoutCallbackReturnValue
runTimeoutCallback(const Name &interest);
@@ -33,8 +53,8 @@
dup() const;
protected:
- TimeoutCallback *m_timeoutCallback;
- DataCallback *m_dataCallback;
+ TimeoutCallback m_timeoutCallback;
+ DataCallback m_dataCallback;
};
} // Ccnx