In common.h, define namespace ptr_lib = boost, and use ptr_lib::shared_ptr<Name>, etc.
diff --git a/ndn-cpp/helpers/hash.cc b/ndn-cpp/helpers/hash.cc
index 0ecf927..aa98784 100644
--- a/ndn-cpp/helpers/hash.cc
+++ b/ndn-cpp/helpers/hash.cc
@@ -49,12 +49,12 @@
unsigned char Hash::_origin = 0;
-HashPtr Hash::Origin(new Hash(&Hash::_origin, sizeof(unsigned char)));
+ptr_lib::shared_ptr<Hash> Hash::Origin(new Hash(&Hash::_origin, sizeof(unsigned char)));
-HashPtr
+ptr_lib::shared_ptr<Hash>
Hash::FromString (const std::string &hashInTextEncoding)
{
- HashPtr retval = make_shared<Hash> (reinterpret_cast<void*> (0), 0);
+ ptr_lib::shared_ptr<Hash> retval = make_shared<Hash> (reinterpret_cast<void*> (0), 0);
if (hashInTextEncoding.size () == 0)
{
@@ -78,10 +78,10 @@
return retval;
}
-HashPtr
+ptr_lib::shared_ptr<Hash>
Hash::FromFileContent (const char *filename)
{
- HashPtr retval = make_shared<Hash> (reinterpret_cast<void*> (0), 0);
+ ptr_lib::shared_ptr<Hash> retval = make_shared<Hash> (reinterpret_cast<void*> (0), 0);
retval->m_buf = new unsigned char [EVP_MAX_MD_SIZE];
EVP_MD_CTX *hash_context = EVP_MD_CTX_create ();
@@ -105,10 +105,10 @@
return retval;
}
-HashPtr
+ptr_lib::shared_ptr<Hash>
Hash::FromBytes (const ndn::Bytes &bytes)
{
- HashPtr retval = make_shared<Hash> (reinterpret_cast<void*> (0), 0);
+ ptr_lib::shared_ptr<Hash> retval = make_shared<Hash> (reinterpret_cast<void*> (0), 0);
retval->m_buf = new unsigned char [EVP_MAX_MD_SIZE];
EVP_MD_CTX *hash_context = EVP_MD_CTX_create ();
diff --git a/ndn-cpp/helpers/hash.h b/ndn-cpp/helpers/hash.h
index 8ac23fa..b5d96aa 100644
--- a/ndn-cpp/helpers/hash.h
+++ b/ndn-cpp/helpers/hash.h
@@ -22,16 +22,11 @@
namespace ndn
{
-
-class Hash;
-typedef boost::shared_ptr<Hash> HashPtr;
-typedef boost::shared_ptr<const Hash> ConstHashPtr;
-
class Hash
{
public:
static unsigned char _origin;
- static HashPtr Origin;
+ static ptr_lib::shared_ptr<Hash> Origin;
Hash ()
: m_buf(0)
@@ -59,13 +54,13 @@
}
}
- static HashPtr
+ static ptr_lib::shared_ptr<Hash>
FromString (const std::string &hashInTextEncoding);
- static HashPtr
+ static ptr_lib::shared_ptr<Hash>
FromFileContent (const char *fileName);
- static HashPtr
+ static ptr_lib::shared_ptr<Hash>
FromBytes (const ndn::Bytes &bytes);
~Hash ()