src: Improving consistency and correcting code style
As of this commit, all data structures can be directly constructed from
wire format.
This commit excludes full correction of code style in security/ and
tools/ndnsec*, which will be part of a different commit.
Change-Id: I121ac1f81948bc7468990df52cdefeb2988d91a1
Refs: #1403
diff --git a/src/management/ndnd-face-instance.hpp b/src/management/ndnd-face-instance.hpp
index 60c07dc..530f10d 100644
--- a/src/management/ndnd-face-instance.hpp
+++ b/src/management/ndnd-face-instance.hpp
@@ -19,12 +19,12 @@
*/
class FaceInstance {
public:
- FaceInstance(const std::string &action,
+ FaceInstance(const std::string& action,
int64_t faceId,
uint32_t ipProto,
- const std::string &host,
- const std::string &port,
- const std::string &multicastInterface,
+ const std::string& host,
+ const std::string& port,
+ const std::string& multicastInterface,
uint32_t multicastTtl,
const time::milliseconds& freshnessPeriod)
: action_(action)
@@ -46,6 +46,15 @@
{
}
+ /**
+ * @brief Create from wire encoding
+ */
+ explicit
+ FaceInstance(const Block& wire)
+ {
+ wireDecode(wire);
+ }
+
// Action
const std::string&
getAction() const { return action_; }
@@ -79,7 +88,7 @@
getPort() const { return port_; }
void
- setPort(const std::string &port) { port_ = port; wire_.reset(); }
+ setPort(const std::string& port) { port_ = port; wire_.reset(); }
// MulticastInterface
const std::string&
@@ -113,7 +122,7 @@
wireEncode() const;
inline void
- wireDecode(const Block &wire);
+ wireDecode(const Block& wire);
private:
std::string action_;
@@ -207,7 +216,7 @@
}
inline void
-FaceInstance::wireDecode(const Block &wire)
+FaceInstance::wireDecode(const Block& wire)
{
action_.clear();
faceId_ = -1;
@@ -289,7 +298,7 @@
}
inline std::ostream&
-operator << (std::ostream &os, const FaceInstance &entry)
+operator << (std::ostream& os, const FaceInstance& entry)
{
os << "FaceInstance(";