Utils/Logger: Implement targets
[senf.git] / Packets / ParseArray.hh
index ad10cca..b7e40bd 100644 (file)
@@ -20,6 +20,9 @@
 // Free Software Foundation, Inc.,
 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+/** \file
+    \brief ParseArray public header */
+
 #ifndef HH_ParseArray_
 #define HH_ParseArray_ 1
 
@@ -39,7 +42,7 @@
     sub-field or sub-collection of the collection is changed). Some collections may provide even
     more lifetime guarantees but this guarantee should be met by all collection wrappers.
 
-    \important Parser lifetime has to be tightly checked when working with collection parsers since
+    \warning Parser lifetime has to be tightly checked when working with collection parsers since
     \e every change of the collections size will invalidate \e all parsers and iterators referencing
     the \e complete packet chain. Collection wrappers do \e not invalidate if the change is \e after
     the collection.
@@ -92,14 +95,29 @@ namespace senf {
         value_type operator[](difference_type i) const;
     };
 
+    /** \brief Define array field
+
+        This macro is a special helper to define a senf::Parse_Array type field, a fixed size
+        collection of fixed size elements.
+        
+        \param[in] name field name
+        \param[in] elt_type array element type
+        \param[in] size constant number of elements
+        \hideinitializer
+        \ingroup packetparsermacros
+     */
+#   define SENF_PARSER_ARRAY(name, elt_type, size)                                                \
+        typedef senf::Parse_Array<size,elt_type> BOOST_PP_CAT(name, _array_t);                    \
+        SENF_PARSER_FIELD( name, BOOST_PP_CAT(name, _array_t) )
+
 }
 
 ///////////////////////////////hh.e////////////////////////////////////////
 #endif
-#if !defined(SENF_PACKETS_DECL_ONLY) && !defined(HH_ParseArray_i_)
+#if !defined(HH_Packets__decls_) && !defined(HH_ParseArray_i_)
 #define HH_ParseArray_i_
 //#include "ParseArray.cci"
-//#include "ParseArray.ct"
+#include "ParseArray.ct"
 #include "ParseArray.cti"
 #endif