Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
senf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wiback
senf
Commits
8d6dddd3
Commit
8d6dddd3
authored
17 years ago
by
g0dil
Browse files
Options
Downloads
Patches
Plain Diff
Packets: complete pcket parser helper macro documentation
parent
d59372a9
No related branches found
No related tags found
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Packets/ParseHelpers.hh
+377
-40
377 additions, 40 deletions
Packets/ParseHelpers.hh
Packets/ParseHelpers.ih
+34
-34
34 additions, 34 deletions
Packets/ParseHelpers.ih
with
411 additions
and
74 deletions
Packets/ParseHelpers.hh
+
377
−
40
View file @
8d6dddd3
This diff is collapsed.
Click to expand it.
Packets/ParseHelpers.ih
+
34
−
34
View file @
8d6dddd3
...
...
@@ -81,7 +81,7 @@
public:
#
# ///////////////////////////////////////////////////////////////////////////
# // SENF_PARSER_FIELD
_
*
# // SENF_PARSER_FIELD*
# // SENF_PARSER_P_FIELD_*
#
# define SENF_PARSER_FIELD_var(name, type) SENF_PARSER_FIELD_I(name, type, var, rw, public)
...
...
@@ -181,20 +181,14 @@
# ////////////////////////////////////////
# // SENF_PARSER_I_FIELD_VAL_*
#
# define SENF_PARSER_I_MAYBECALL_var() ()
# define SENF_PARSER_I_MAYBECALL_fix()
#
# define SENF_PARSER_I_FIELD_VAL_rw(name, type, ofstype, access) \
# define SENF_PARSER_I_FIELD_VAL_rw(name, type, access) \
BOOST_PP_CAT(name, _t) name() const { \
return parse<type>( \
BOOST_PP_CAT(name,_offset) BOOST_PP_CAT(SENF_PARSER_I_MAYBECALL_, ofstype)()); \
return parse<type>( SENF_PARSER_OFFSET(name) ); \
}
#
# define SENF_PARSER_I_FIELD_VAL_ro(name, type, ofstype, access) \
BOOST_PP_CAT(name, _t)::value_type name() const { \
return parse<type>( \
BOOST_PP_CAT(name,_offset) BOOST_PP_CAT(SENF_PARSER_I_MAYBECALL_, ofstype)()) \
.value(); \
return parse<type>( SENF_PARSER_OFFSET(name) ).value(); \
}
#
# ///////////////////////////////////////////////////////////////////////////
...
...
@@ -288,30 +282,6 @@
SENF_MPL_SLOT_SET(bitfield_size, 0);
#
# ///////////////////////////////////////////////////////////////////////////
# // SENF_PARSER_FINALIZE_*
#
# define SENF_PARSER_FINALIZE_var(name) \
SENF_PARSER_FINALIZE_GENERIC(name) \
size_type bytes() const { \
return field_offset_(static_cast<senf::mpl::rv<SENF_MPL_SLOT_GET(index)>*>(0)); \
} \
static size_type const init_bytes = SENF_MPL_SLOT_GET(init_bytes)
#
# define SENF_PARSER_FINALIZE_fix(name) \
SENF_PARSER_FINALIZE_GENERIC(name) \
static size_type const fixed_bytes = SENF_MPL_SLOT_GET(offset);
#
# define SENF_PARSER_FINALIZE_GENERIC(name) \
void defaultInit() { \
init_chain(static_cast<senf::mpl::rv<SENF_MPL_SLOT_GET(index)>*>(0)); \
} \
name(data_iterator i, state_type s) : parser_base_type(i,s) {} \
private: \
template <class T> void init(T) { defaultInit(); } \
public: \
void init() { init(0); }
#
# ///////////////////////////////////////////////////////////////////////////
# // SENF_PARSER_SKIP_*
#
# define SENF_PARSER_SKIP_var(bytes, ibytes) \
...
...
@@ -391,6 +361,36 @@
BOOST_PP_CAT(SENF_PARSER_I_ADVANCE_OFS_, ofstype) (name, void, 0, 0,access) \
public:
#
# ///////////////////////////////////////////////////////////////////////////
# // SENF_PARSER_OFFSET_*
#
# define SENF_PARSER_OFFSET_fix(name) BOOST_PP_CAT(name, _offset)
# define SENF_PARSER_OFFSET_var(name) BOOST_PP_CAT(name, _offset)()
#
# ///////////////////////////////////////////////////////////////////////////
# // SENF_PARSER_FINALIZE_*
#
# define SENF_PARSER_FINALIZE_var(name) \
SENF_PARSER_FINALIZE_GENERIC(name) \
size_type bytes() const { \
return field_offset_(static_cast<senf::mpl::rv<SENF_MPL_SLOT_GET(index)>*>(0)); \
} \
static size_type const init_bytes = SENF_MPL_SLOT_GET(init_bytes)
#
# define SENF_PARSER_FINALIZE_fix(name) \
SENF_PARSER_FINALIZE_GENERIC(name) \
static size_type const fixed_bytes = SENF_MPL_SLOT_GET(offset);
#
# define SENF_PARSER_FINALIZE_GENERIC(name) \
void defaultInit() { \
init_chain(static_cast<senf::mpl::rv<SENF_MPL_SLOT_GET(index)>*>(0)); \
} \
name(data_iterator i, state_type s) : parser_base_type(i,s) {} \
private: \
template <class T> void init(T) { defaultInit(); } \
public: \
void init() { init(0); }
#
# ////////////////////////////////ih.e///////////////////////////////////////
# endif
#
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment