src: Updating code style to conform (more or less) to ndn-cxx style
Also, adding .clang-format that describes the applied style. Note that
this style requires a slightly customized version of clang-format.
diff --git a/utils/tracers/ndn-l3-tracer.hpp b/utils/tracers/ndn-l3-tracer.hpp
index 2f132bd..d3534fa 100644
--- a/utils/tracers/ndn-l3-tracer.hpp
+++ b/utils/tracers/ndn-l3-tracer.hpp
@@ -49,25 +49,24 @@
* @ingroup ndn-tracers
* @brief Base class for network-layer (incoming/outgoing Interests and Data) tracing of NDN stack
*/
-class L3Tracer : public SimpleRefCount<L3Tracer>
-{
+class L3Tracer : public SimpleRefCount<L3Tracer> {
public:
/**
* @brief Trace constructor that attaches to the node using node pointer
* @param node pointer to the node
*/
- L3Tracer (Ptr<Node> node);
+ L3Tracer(Ptr<Node> node);
/**
* @brief Trace constructor that attaches to the node using node name
* @param nodeName name of the node registered using Names::Add
*/
- L3Tracer (const std::string &node);
+ L3Tracer(const std::string& node);
/**
* @brief Destructor
*/
- virtual ~L3Tracer ();
+ virtual ~L3Tracer();
/**
* @brief Print head of the trace (e.g., for post-processing)
@@ -75,7 +74,7 @@
* @param os reference to output stream
*/
virtual void
- PrintHeader (std::ostream &os) const = 0;
+ PrintHeader(std::ostream& os) const = 0;
/**
* @brief Print current trace data
@@ -83,63 +82,62 @@
* @param os reference to output stream
*/
virtual void
- Print (std::ostream &os) const = 0;
+ Print(std::ostream& os) const = 0;
protected:
void
- Connect ();
+ Connect();
virtual void
- OutInterests (Ptr<const Interest>, Ptr<const Face>) = 0;
+ OutInterests(Ptr<const Interest>, Ptr<const Face>) = 0;
virtual void
- InInterests (Ptr<const Interest>, Ptr<const Face>) = 0;
+ InInterests(Ptr<const Interest>, Ptr<const Face>) = 0;
virtual void
- DropInterests (Ptr<const Interest>, Ptr<const Face>) = 0;
+ DropInterests(Ptr<const Interest>, Ptr<const Face>) = 0;
virtual void
- OutNacks (Ptr<const Interest>, Ptr<const Face>) = 0;
+ OutNacks(Ptr<const Interest>, Ptr<const Face>) = 0;
virtual void
- InNacks (Ptr<const Interest>, Ptr<const Face>) = 0;
+ InNacks(Ptr<const Interest>, Ptr<const Face>) = 0;
virtual void
- DropNacks (Ptr<const Interest>, Ptr<const Face>) = 0;
-
+ DropNacks(Ptr<const Interest>, Ptr<const Face>) = 0;
virtual void
- OutData (Ptr<const Data>, bool fromCache, Ptr<const Face>) = 0;
+ OutData(Ptr<const Data>, bool fromCache, Ptr<const Face>) = 0;
virtual void
- InData (Ptr<const Data>, Ptr<const Face>) = 0;
+ InData(Ptr<const Data>, Ptr<const Face>) = 0;
virtual void
- DropData (Ptr<const Data>, Ptr<const Face>) = 0;
+ DropData(Ptr<const Data>, Ptr<const Face>) = 0;
virtual void
- SatisfiedInterests (Ptr<const pit::Entry>) = 0;
+ SatisfiedInterests(Ptr<const pit::Entry>) = 0;
virtual void
- TimedOutInterests (Ptr<const pit::Entry>) = 0;
+ TimedOutInterests(Ptr<const pit::Entry>) = 0;
protected:
std::string m_node;
Ptr<Node> m_nodePtr;
- struct Stats
- {
- inline void Reset ()
+ struct Stats {
+ inline void
+ Reset()
{
- m_inInterests = 0;
- m_outInterests = 0;
+ m_inInterests = 0;
+ m_outInterests = 0;
m_dropInterests = 0;
- m_inNacks = 0;
- m_outNacks = 0;
- m_dropNacks = 0;
- m_inData = 0;
- m_outData = 0;
- m_dropData = 0;
+ m_inNacks = 0;
+ m_outNacks = 0;
+ m_dropNacks = 0;
+ m_inData = 0;
+ m_outData = 0;
+ m_dropData = 0;
m_satisfiedInterests = 0;
m_timedOutInterests = 0;
@@ -167,12 +165,12 @@
* @brief Helper to dump the trace to an output stream
*/
inline std::ostream&
-operator << (std::ostream &os, const L3Tracer &tracer)
+operator<<(std::ostream& os, const L3Tracer& tracer)
{
os << "# ";
- tracer.PrintHeader (os);
+ tracer.PrintHeader(os);
os << "\n";
- tracer.Print (os);
+ tracer.Print(os);
return os;
}