In all .cpp files, remove using namespace ndn::ptr_lib and explicitly use ptr_lib::shared_ptr and make_shared.
diff --git a/src/security/certificate/certificate-extension.cpp b/src/security/certificate/certificate-extension.cpp
index b2c1bad..f081f2a 100644
--- a/src/security/certificate/certificate-extension.cpp
+++ b/src/security/certificate/certificate-extension.cpp
@@ -11,18 +11,17 @@
#include <ndn-cpp/security/certificate/certificate-extension.hpp>
using namespace std;
-using namespace ndn::ptr_lib;
namespace ndn {
-shared_ptr<der::DerNode>
+ptr_lib::shared_ptr<der::DerNode>
CertificateExtension::toDer()
{
- shared_ptr<der::DerSequence> root(new der::DerSequence);
+ ptr_lib::shared_ptr<der::DerSequence> root(new der::DerSequence);
- shared_ptr<der::DerOid> extensionId(new der::DerOid(extensionId_));
- shared_ptr<der::DerBool> isCritical(new der::DerBool(isCritical_));
- shared_ptr<der::DerOctetString> extensionValue(new der::DerOctetString(*extensionValue_));
+ ptr_lib::shared_ptr<der::DerOid> extensionId(new der::DerOid(extensionId_));
+ ptr_lib::shared_ptr<der::DerBool> isCritical(new der::DerBool(isCritical_));
+ ptr_lib::shared_ptr<der::DerOctetString> extensionValue(new der::DerOctetString(*extensionValue_));
root->addChild(extensionId);
root->addChild(isCritical);
diff --git a/src/security/certificate/certificate-subject-description.cpp b/src/security/certificate/certificate-subject-description.cpp
index ee2310c..9aa511f 100644
--- a/src/security/certificate/certificate-subject-description.cpp
+++ b/src/security/certificate/certificate-subject-description.cpp
@@ -10,17 +10,16 @@
#include <ndn-cpp/security/certificate/certificate-subject-description.hpp>
using namespace std;
-using namespace ndn::ptr_lib;
namespace ndn {
-shared_ptr<der::DerNode>
+ptr_lib::shared_ptr<der::DerNode>
CertificateSubjectDescription::toDer()
{
- shared_ptr<der::DerSequence> root(new der::DerSequence());
+ ptr_lib::shared_ptr<der::DerSequence> root(new der::DerSequence());
- shared_ptr<der::DerOid> oid(new der::DerOid(oid_));
- shared_ptr<der::DerPrintableString> value(new der::DerPrintableString(value_));
+ ptr_lib::shared_ptr<der::DerOid> oid(new der::DerOid(oid_));
+ ptr_lib::shared_ptr<der::DerPrintableString> value(new der::DerPrintableString(value_));
root->addChild(oid);
root->addChild(value);
diff --git a/src/security/certificate/certificate.cpp b/src/security/certificate/certificate.cpp
index 6856a2a..82b6364 100644
--- a/src/security/certificate/certificate.cpp
+++ b/src/security/certificate/certificate.cpp
@@ -22,7 +22,6 @@
INIT_LOGGER("ndn.security.Certificate");
using namespace std;
-using namespace ndn::ptr_lib;
namespace ndn {
@@ -68,20 +67,20 @@
void
Certificate::encode()
{
- shared_ptr<der::DerSequence> root(new der::DerSequence());
+ ptr_lib::shared_ptr<der::DerSequence> root(new der::DerSequence());
- shared_ptr<der::DerSequence> validity(new der::DerSequence());
- shared_ptr<der::DerGtime> notBefore(new der::DerGtime(notBefore_));
- shared_ptr<der::DerGtime> notAfter(new der::DerGtime(notAfter_));
+ ptr_lib::shared_ptr<der::DerSequence> validity(new der::DerSequence());
+ ptr_lib::shared_ptr<der::DerGtime> notBefore(new der::DerGtime(notBefore_));
+ ptr_lib::shared_ptr<der::DerGtime> notAfter(new der::DerGtime(notAfter_));
validity->addChild(notBefore);
validity->addChild(notAfter);
root->addChild(validity);
- shared_ptr<der::DerSequence> subjectList(new der::DerSequence());
+ ptr_lib::shared_ptr<der::DerSequence> subjectList(new der::DerSequence());
SubjectDescriptionList::iterator it = subjectDescriptionList_.begin();
for(; it != subjectDescriptionList_.end(); it++)
{
- shared_ptr<der::DerNode> child = it->toDer();
+ ptr_lib::shared_ptr<der::DerNode> child = it->toDer();
subjectList->addChild(child);
}
root->addChild(subjectList);
@@ -90,7 +89,7 @@
if(!extensionList_.empty())
{
- shared_ptr<der::DerSequence> extnList(new der::DerSequence());
+ ptr_lib::shared_ptr<der::DerSequence> extnList(new der::DerSequence());
ExtensionList::iterator it = extensionList_.begin();
for(; it != extensionList_.end(); it++)
extnList->addChild(it->toDer());
@@ -102,7 +101,7 @@
root->encode(start);
- shared_ptr<vector<uint8_t> > blob = blobStream.buf();
+ ptr_lib::shared_ptr<vector<uint8_t> > blob = blobStream.buf();
setContent(blob);
getMetaInfo().setType(ndn_ContentType_KEY);
}
@@ -114,7 +113,7 @@
ndnboost::iostreams::stream<ndnboost::iostreams::array_source> is((const char*)blob.buf(), blob.size());
- shared_ptr<der::DerNode> node = der::DerNode::parse(reinterpret_cast<der::InputIterator&>(is));
+ ptr_lib::shared_ptr<der::DerNode> node = der::DerNode::parse(reinterpret_cast<der::InputIterator&>(is));
// der::PrintVisitor printVisitor;
// node->accept(printVisitor, string(""));
@@ -138,7 +137,7 @@
ndnboost::iostreams::stream<ndnboost::iostreams::array_source> is((const char*)key_.getKeyDer().buf(), key_.getKeyDer().size());
- shared_ptr<der::DerNode> keyRoot = der::DerNode::parse(reinterpret_cast<der::InputIterator&> (is));
+ ptr_lib::shared_ptr<der::DerNode> keyRoot = der::DerNode::parse(reinterpret_cast<der::InputIterator&> (is));
der::PrintVisitor printVisitor;
keyRoot->accept(printVisitor, string(""));
diff --git a/src/security/certificate/public-key.cpp b/src/security/certificate/public-key.cpp
index 1d5deb8..f57f5a6 100644
--- a/src/security/certificate/public-key.cpp
+++ b/src/security/certificate/public-key.cpp
@@ -15,11 +15,10 @@
#include <ndn-cpp/security/certificate/public-key.hpp>
using namespace std;
-using namespace ndn::ptr_lib;
namespace ndn {
-shared_ptr<der::DerNode>
+ptr_lib::shared_ptr<der::DerNode>
PublicKey::toDer()
{
ndnboost::iostreams::stream<ndnboost::iostreams::array_source> is((const char*)keyDer_.buf (), keyDer_.size ());
@@ -29,7 +28,7 @@
static int RSA_OID[] = { 1, 2, 840, 113549, 1, 1, 1 };
-shared_ptr<PublicKey>
+ptr_lib::shared_ptr<PublicKey>
PublicKey::fromDer(const Blob& keyDer)
{
// Use a temporary pointer since d2i updates it.
@@ -39,7 +38,7 @@
throw UnrecognizedKeyFormatException("Error decoding public key DER");
RSA_free(publicKey);
- return shared_ptr<PublicKey>(new PublicKey(OID(vector<int>(RSA_OID, RSA_OID + sizeof(RSA_OID))), keyDer));
+ return ptr_lib::shared_ptr<PublicKey>(new PublicKey(OID(vector<int>(RSA_OID, RSA_OID + sizeof(RSA_OID))), keyDer));
}
Blob