Code style: Declare (Type& value) instead of (Type &value)
diff --git a/ndn-cpp/interest.hpp b/ndn-cpp/interest.hpp
index e4aeeb1..b3397af 100644
--- a/ndn-cpp/interest.hpp
+++ b/ndn-cpp/interest.hpp
@@ -38,7 +38,7 @@
* WARNING: The resulting pointer in excludeEntryStruct is invalid after a further use of this object which could reallocate memory.
* @param excludeEntryStruct the C ndn_NameComponent struct to receive the pointer
*/
- void get(struct ndn_ExcludeEntry &excludeEntryStruct) const
+ void get(struct ndn_ExcludeEntry& excludeEntryStruct) const
{
excludeEntryStruct.type = type_;
if (type_ == ndn_Exclude_COMPONENT)
@@ -47,7 +47,7 @@
ndn_ExcludeType getType() const { return type_; }
- const Name::Component &getComponent() const { return component_; }
+ const Name::Component& getComponent() const { return component_; }
private:
ndn_ExcludeType type_;
@@ -69,20 +69,20 @@
return entries_.size();
}
- const ExcludeEntry &getEntry(unsigned int i) const { return entries_[i]; }
+ const ExcludeEntry& getEntry(unsigned int i) const { return entries_[i]; }
/**
* Set the excludeStruct to point to the entries in this Exclude, without copying any memory.
* WARNING: The resulting pointers in excludeStruct are invalid after a further use of this object which could reallocate memory.
* @param excludeStruct a C ndn_Exclude struct where the entries array is already allocated
*/
- void get(struct ndn_Exclude &excludeStruct) const;
+ void get(struct ndn_Exclude& excludeStruct) const;
/**
* Clear this Exclude, and set the entries by copying from the ndn_Exclude struct.
* @param excludeStruct a C ndn_Exclude struct
*/
- void set(const struct ndn_Exclude &excludeStruct);
+ void set(const struct ndn_Exclude& excludeStruct);
/**
* Add a new entry of type ndn_Exclude_ANY
@@ -122,9 +122,9 @@
*/
class Interest {
public:
- Interest(const Name &name, int minSuffixComponents, int maxSuffixComponents,
- const PublisherPublicKeyDigest &publisherPublicKeyDigest, const Exclude &exclude, int childSelector, int answerOriginKind,
- int scope, double interestLifetimeMilliseconds, const std::vector<unsigned char> &nonce)
+ Interest(const Name& name, int minSuffixComponents, int maxSuffixComponents,
+ const PublisherPublicKeyDigest& publisherPublicKeyDigest, const Exclude& exclude, int childSelector, int answerOriginKind,
+ int scope, double interestLifetimeMilliseconds, const std::vector<unsigned char>& nonce)
: name_(name), minSuffixComponents_(minSuffixComponents), maxSuffixComponents_(maxSuffixComponents),
publisherPublicKeyDigest_(publisherPublicKeyDigest), exclude_(exclude), childSelector_(childSelector),
answerOriginKind_(answerOriginKind), scope_(scope), interestLifetimeMilliseconds_(interestLifetimeMilliseconds),
@@ -132,8 +132,8 @@
{
}
- Interest(const Name &name, int minSuffixComponents, int maxSuffixComponents,
- const PublisherPublicKeyDigest &publisherPublicKeyDigest, const Exclude &exclude, int childSelector, int answerOriginKind,
+ Interest(const Name& name, int minSuffixComponents, int maxSuffixComponents,
+ const PublisherPublicKeyDigest& publisherPublicKeyDigest, const Exclude& exclude, int childSelector, int answerOriginKind,
int scope, double interestLifetimeMilliseconds)
: name_(name), minSuffixComponents_(minSuffixComponents), maxSuffixComponents_(maxSuffixComponents),
publisherPublicKeyDigest_(publisherPublicKeyDigest), exclude_(exclude), childSelector_(childSelector),
@@ -141,14 +141,14 @@
{
}
- Interest(const Name &name, double interestLifetimeMilliseconds)
+ Interest(const Name& name, double interestLifetimeMilliseconds)
: name_(name)
{
construct();
interestLifetimeMilliseconds_ = interestLifetimeMilliseconds;
}
- Interest(const Name &name)
+ Interest(const Name& name)
: name_(name)
{
construct();
@@ -159,7 +159,7 @@
construct();
}
- ptr_lib::shared_ptr<std::vector<unsigned char> > wireEncode(WireFormat &wireFormat) const
+ ptr_lib::shared_ptr<std::vector<unsigned char> > wireEncode(WireFormat& wireFormat) const
{
return wireFormat.encodeInterest(*this);
}
@@ -167,7 +167,7 @@
{
return wireEncode(*WireFormat::getDefaultWireFormat());
}
- void wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat &wireFormat)
+ void wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat)
{
wireFormat.decodeInterest(*this, input, inputLength);
}
@@ -175,11 +175,11 @@
{
wireDecode(input, inputLength, *WireFormat::getDefaultWireFormat());
}
- void wireDecode(const std::vector<unsigned char> &input, WireFormat &wireFormat)
+ void wireDecode(const std::vector<unsigned char>& input, WireFormat& wireFormat)
{
wireDecode(&input[0], input.size(), wireFormat);
}
- void wireDecode(const std::vector<unsigned char> &input)
+ void wireDecode(const std::vector<unsigned char>& input)
{
wireDecode(&input[0], input.size());
}
@@ -189,20 +189,20 @@
* WARNING: The resulting pointers in interestStruct are invalid after a further use of this object which could reallocate memory.
* @param interestStruct a C ndn_Interest struct where the name components array is already allocated.
*/
- void get(struct ndn_Interest &interestStruct) const;
+ void get(struct ndn_Interest& interestStruct) const;
- Name &getName() { return name_; }
- const Name &getName() const { return name_; }
+ Name& getName() { return name_; }
+ const Name& getName() const { return name_; }
int getMinSuffixComponents() const { return minSuffixComponents_; }
int getMaxSuffixComponents() const { return maxSuffixComponents_; }
- PublisherPublicKeyDigest &getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
- const PublisherPublicKeyDigest &getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
+ PublisherPublicKeyDigest& getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
+ const PublisherPublicKeyDigest& getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
- Exclude &getExclude() { return exclude_; }
- const Exclude &getExclude() const { return exclude_; }
+ Exclude& getExclude() { return exclude_; }
+ const Exclude& getExclude() const { return exclude_; }
int getChildSelector() const { return childSelector_; }
@@ -212,13 +212,13 @@
double getInterestLifetimeMilliseconds() const { return interestLifetimeMilliseconds_; }
- const std::vector<unsigned char> &getNonce() const { return nonce_; }
+ const std::vector<unsigned char>& getNonce() const { return nonce_; }
/**
* Clear this interest, and set the values by copying from the interest struct.
* @param interestStruct a C ndn_Interest struct
*/
- void set(const struct ndn_Interest &interestStruct);
+ void set(const struct ndn_Interest& interestStruct);
void setMinSuffixComponents(int value) { minSuffixComponents_ = value; }
@@ -232,7 +232,7 @@
void setInterestLifetimeMilliseconds(double value) { interestLifetimeMilliseconds_ = value; }
- void setNonce(const std::vector<unsigned char> &value) { nonce_ = value; }
+ void setNonce(const std::vector<unsigned char>& value) { nonce_ = value; }
private:
void construct()