Browse Source

In set methods, make the argument const

pull/1/head
Jeff Thompson 12 years ago
parent
commit
dd3d229d6d
  1. 4
      ndn-cpp/Interest.cpp
  2. 4
      ndn-cpp/Interest.hpp
  3. 2
      ndn-cpp/Name.cpp
  4. 2
      ndn-cpp/Name.hpp
  5. 2
      ndn-cpp/PublisherPublicKeyDigest.hpp

4
ndn-cpp/Interest.cpp

@ -20,7 +20,7 @@ void Exclude::get(struct ndn_Exclude &excludeStruct) const
entries_[i].get(excludeStruct.entries[i]);
}
void Exclude::set(struct ndn_Exclude &excludeStruct)
void Exclude::set(const struct ndn_Exclude &excludeStruct)
{
entries_.clear();
for (unsigned int i = 0; i < excludeStruct.nEntries; ++i) {
@ -35,7 +35,7 @@ void Exclude::set(struct ndn_Exclude &excludeStruct)
}
}
void Interest::set(struct ndn_Interest &interestStruct)
void Interest::set(const struct ndn_Interest &interestStruct)
{
name_.set(interestStruct.name);
minSuffixComponents_ = interestStruct.minSuffixComponents;

4
ndn-cpp/Interest.hpp

@ -85,7 +85,7 @@ public:
* Clear this Exclude, and set the entries by copying from the ndn_Exclude struct.
* @param excludeStruct a C ndn_Exclude struct
*/
void set(struct ndn_Exclude &excludeStruct);
void set(const struct ndn_Exclude &excludeStruct);
/**
* Add a new entry of type ndn_Exclude_ANY
@ -178,7 +178,7 @@ public:
* Clear this interest, and set the values by copying from the interest struct.
* @param interestStruct a C ndn_Interest struct
*/
void set(struct ndn_Interest &interestStruct);
void set(const struct ndn_Interest &interestStruct);
void setMinSuffixComponents(int value) { minSuffixComponents_ = value; }

2
ndn-cpp/Name.cpp

@ -236,7 +236,7 @@ void Name::get(struct ndn_Name &nameStruct) const
components_[i].get(nameStruct.components[i]);
}
void Name::set(struct ndn_Name &nameStruct)
void Name::set(const struct ndn_Name &nameStruct)
{
clear();
for (unsigned int i = 0; i < nameStruct.nComponents; ++i)

2
ndn-cpp/Name.hpp

@ -101,7 +101,7 @@ public:
* Clear this name, and set the components by copying from the name struct.
* @param nameStruct a C ndn_Name struct
*/
void set(struct ndn_Name &nameStruct);
void set(const struct ndn_Name &nameStruct);
/**
* Add a new component, copying from value of length valueLength.

2
ndn-cpp/PublisherPublicKeyDigest.hpp

@ -38,7 +38,7 @@ public:
* Clear this PublisherPublicKeyDigest, and copy from the ndn_PublisherPublicKeyDigest struct.
* @param excludeStruct a C ndn_Exclude struct
*/
void set(struct ndn_PublisherPublicKeyDigest &publisherPublicKeyDigestStruct)
void set(const struct ndn_PublisherPublicKeyDigest &publisherPublicKeyDigestStruct)
{
publisherPublicKeyDigest_.clear();
if (publisherPublicKeyDigestStruct.publisherPublicKeyDigest)

Loading…
Cancel
Save