Adding more doxygen documentation
diff --git a/helper/ccnb-parser/syntax-tree/ccnb-parser-blob.h b/helper/ccnb-parser/syntax-tree/ccnb-parser-blob.h
index f2ede3d..195c84c 100644
--- a/helper/ccnb-parser/syntax-tree/ccnb-parser-blob.h
+++ b/helper/ccnb-parser/syntax-tree/ccnb-parser-blob.h
@@ -52,7 +52,7 @@
virtual boost::any accept( Visitor &v, boost::any param ) { return v.visit( *this, param ); }
char* m_blob; ///< \brief field holding a parsed BLOB value of the block
- uint32_t m_blobSize;
+ uint32_t m_blobSize; ///< @brief field representing size of the BLOB field stored
};
}
diff --git a/helper/ccnb-parser/syntax-tree/ccnb-parser-block.cc b/helper/ccnb-parser/syntax-tree/ccnb-parser-block.cc
index 29e3fac..805582a 100644
--- a/helper/ccnb-parser/syntax-tree/ccnb-parser-block.cc
+++ b/helper/ccnb-parser/syntax-tree/ccnb-parser-block.cc
@@ -35,10 +35,12 @@
namespace ns3 {
namespace CcnbParser {
+/// @cond include_hidden
const uint8_t CCN_TT_BITS = 3;
const uint8_t CCN_TT_MASK = ((1 << CCN_TT_BITS) - 1);
const uint8_t CCN_MAX_TINY= ((1 << (7-CCN_TT_BITS)) - 1);
const uint8_t CCN_TT_HBIT = ((uint8_t)(1 << 7));
+/// @endcond
// int Block::counter = 0;
diff --git a/helper/ccnb-parser/syntax-tree/ccnb-parser-block.h b/helper/ccnb-parser/syntax-tree/ccnb-parser-block.h
index 9538a1f..6ea5fba 100644
--- a/helper/ccnb-parser/syntax-tree/ccnb-parser-block.h
+++ b/helper/ccnb-parser/syntax-tree/ccnb-parser-block.h
@@ -59,13 +59,17 @@
virtual ~Block ();
- virtual void accept( VoidNoArguVisitor &v ) = 0;
- virtual void accept( VoidVisitor &v, boost::any param ) = 0;
- virtual boost::any accept( NoArguVisitor &v ) = 0;
- virtual boost::any accept( Visitor &v, boost::any param ) = 0;
+ virtual void accept( VoidNoArguVisitor &v ) = 0; ///< @brief Accept visitor void(*)()
+ virtual void accept( VoidVisitor &v, boost::any param ) = 0; ///< @brief Accept visitor void(*)(boost::any)
+ virtual boost::any accept( NoArguVisitor &v ) = 0; ///< @brief Accept visitor boost::any(*)()
+ virtual boost::any accept( Visitor &v, boost::any param ) = 0; ///< @brief Accept visitor boost::any(*)(boost::any)
};
-// Necessary until Buffer::Iterator gets PeekU8 call
+/**
+ * @brief Necessary until Buffer::Iterator gets PeekU8 call
+ * @param i buffer iterator
+ * @return peeked uint8_t value
+ */
inline
uint8_t
BufferIteratorPeekU8 (Buffer::Iterator &i)
diff --git a/helper/ccnx-encoding-helper.h b/helper/ccnx-encoding-helper.h
index 65b3b6a..45fdc84 100644
--- a/helper/ccnx-encoding-helper.h
+++ b/helper/ccnx-encoding-helper.h
@@ -37,7 +37,6 @@
/**
* \brief Helper to encode/decode ccnb formatted CCNx message
- *
*/
class CcnxEncodingHelper
{
@@ -60,24 +59,67 @@
GetSerializedSize (const CcnxInterestHeader &interest);
public:
+ /**
+ * @brief Append CCNB block header
+ * @param start Buffer to store serialized CcnxInterestHeader
+ * @param value dictionary id of the block header
+ * @param block_type Type of CCNB block
+ *
+ * @returns written length
+ */
static size_t
AppendBlockHeader (Buffer::Iterator &start, size_t value, CcnbParser::ccn_tt block_type);
+ /**
+ * @brief Estimate size of the CCNB block header
+ * @param value dictionary id of the block header
+ * @returns estimated length
+ */
static size_t
EstimateBlockHeader (size_t value);
+ /**
+ * @brief Add number in CCNB encoding
+ * @param start Buffer to store serialized CcnxInterestHeader
+ * @param number Number to be written
+ *
+ * @returns written length
+ */
static size_t
AppendNumber (Buffer::Iterator &start, uint32_t number);
+ /**
+ * @brief Estimate size of the number in CCNB encoding
+ * @param number Number to be written
+ * @returns estimated length
+ */
static size_t
EstimateNumber (uint32_t number);
+ /**
+ * @brief Append CCNB closer tag (estimated size is 1)
+ * @param start Buffer to store serialized CcnxInterestHeader
+ *
+ * @returns written length
+ */
static size_t
AppendCloser (Buffer::Iterator &start);
+ /**
+ * @brief Append CcnxNameComponents in CCNB encoding
+ * @param start Buffer to store serialized CcnxInterestHeader
+ * @param name constant reference to CcnxNameComponents object
+ *
+ * @returns written length
+ */
static size_t
AppendNameComponents (Buffer::Iterator &start, const CcnxNameComponents &name);
+ /**
+ * @brief Estimate size of CcnxNameComponents in CCNB encoding
+ * @param name constant reference to CcnxNameComponents object
+ * @returns estimated length
+ */
static size_t
EstimateNameComponents (const CcnxNameComponents &name);
@@ -93,6 +135,11 @@
static size_t
AppendTimestampBlob (Buffer::Iterator &start, const Time &time);
+ /**
+ * @brief Estimate size of a binary timestamp as a BLOB using CCNB enconding
+ * @param time - Time object
+ * @returns estimated length
+ */
static size_t
EstimateTimestampBlob (const Time &time);
@@ -112,6 +159,12 @@
AppendTaggedBlob (Buffer::Iterator &start, CcnbParser::ccn_dtag dtag,
const uint8_t *data, size_t size);
+ /**
+ * @brief Estimate size of a tagged BLOB in CCNB enconding
+ * @param dtag is the element's dtab
+ * @param size is the size of the data, in bytes
+ * @returns estimated length
+ */
static size_t
EstimateTaggedBlob (CcnbParser::ccn_dtag dtag, size_t size);
@@ -147,6 +200,12 @@
AppendString (Buffer::Iterator &start, CcnbParser::ccn_dtag dtag,
const std::string &string);
+ /**
+ * @brief Estimate size of the string in CCNB encoding
+ * @param dtag is the element's dtab
+ * @param string UTF-8 string to be written
+ * @returns estimated length
+ */
static size_t
EstimateString (CcnbParser::ccn_dtag dtag, const std::string &string);
};
diff --git a/helper/ccnx-header-helper.h b/helper/ccnx-header-helper.h
index f4096db..7a23c6d 100644
--- a/helper/ccnx-header-helper.h
+++ b/helper/ccnx-header-helper.h
@@ -50,7 +50,10 @@
class CcnxHeaderHelper
{
public:
- enum Type {INTEREST, CONTENT_OBJECT};
+ /**
+ @brief enum for Ccnx packet types
+ */
+ enum Type {INTEREST, CONTENT_OBJECT};
/**
* Static function to create an appropriate CCNx header