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
354cc867
Commit
354cc867
authored
17 years ago
by
g0dil
Browse files
Options
Downloads
Patches
Plain Diff
PPI: Move generic packet typeid check into connector base-class
parent
b897d81a
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
PPI/Connectors.cc
+5
-0
5 additions, 0 deletions
PPI/Connectors.cc
PPI/Connectors.hh
+9
-12
9 additions, 12 deletions
PPI/Connectors.hh
PPI/Route.ih
+4
-0
4 additions, 0 deletions
PPI/Route.ih
Packets/ParseHelpers.hh
+1
-1
1 addition, 1 deletion
Packets/ParseHelpers.hh
with
19 additions
and
13 deletions
PPI/Connectors.cc
+
5
−
0
View file @
354cc867
...
...
@@ -53,6 +53,11 @@ prefix_ void senf::ppi::connector::Connector::connect(Connector & target)
target
.
peer_
=
this
;
}
prefix_
std
::
type_info
const
&
senf
::
ppi
::
connector
::
Connector
::
packetTypeID
()
{
return
typeid
(
void
);
}
///////////////////////////////////////////////////////////////////////////
// senf::ppi::connector::PassiveConnector
...
...
This diff is collapsed.
Click to expand it.
PPI/Connectors.hh
+
9
−
12
View file @
354cc867
...
...
@@ -123,7 +123,7 @@ namespace connector {
void
connect
(
Connector
&
target
);
private:
virtual
std
::
type_info
const
&
packetTypeID
()
=
0
;
virtual
std
::
type_info
const
&
packetTypeID
();
void
setModule
(
module
::
Module
&
module
);
...
...
@@ -456,27 +456,24 @@ namespace connector {
# define TypedConnector_Input read
# define TypedConnector_Output write
# define TypedConnector(pType, dir)
\
# define TypedConnector(pType, dir) \
template <class PacketType> \
class pType ## dir
\
: public Generic ## pType ## dir,
\
private detail::Typed ## dir ## Mixin<pType ## dir <PacketType>, PacketType>
\
class pType ## dir \
: public Generic ## pType ## dir, \
private detail::Typed ## dir ## Mixin<pType ## dir <PacketType>, PacketType> \
{ \
typedef detail::Typed ## dir ## Mixin<pType ## dir <PacketType>, PacketType> mixin;
\
typedef detail::Typed ## dir ## Mixin<pType ## dir <PacketType>, PacketType> mixin; \
public: \
using mixin::operator(); \
using mixin::TypedConnector_ ## dir ; \
private: \
virtual std::type_info const & packetTypeID() \
{ return typeid(typename PacketType::type); } \
friend class detail::Typed ## dir ## Mixin<pType ## dir <PacketType>, PacketType>;
\
friend class detail::Typed ## dir ## Mixin<pType ## dir <PacketType>, PacketType>; \
}; \
template <> \
class pType ## dir <Packet> : public Generic ## pType ## dir \
{ \
private: \
virtual std::type_info const & packetTypeID() { return typeid(void); } \
}
class pType ## dir <Packet> : public Generic ## pType ## dir \
{}
TypedConnector
(
Passive
,
Input
);
TypedConnector
(
Passive
,
Output
);
...
...
This diff is collapsed.
Click to expand it.
PPI/Route.ih
+
4
−
0
View file @
354cc867
...
...
@@ -47,6 +47,8 @@ namespace detail {
struct RoutingTraitsImplementation
{
BOOST_STATIC_ASSERT((boost::is_base_of<connector::Connector, Connector>::value));
static bool const event = false;
static bool const notifySource = boost::is_base_of<
connector::ActiveConnector, Connector>::value;
...
...
@@ -66,6 +68,8 @@ namespace detail {
template <class Event>
struct RoutingTraitsImplementation<Event,true>
{
static bool const event = true;
static bool const notifySource = false;
static bool const notifyTarget = true;
...
...
This diff is collapsed.
Click to expand it.
Packets/ParseHelpers.hh
+
1
−
1
View file @
354cc867
...
...
@@ -278,7 +278,7 @@
\ingroup packetparser
*/
///\
in
group packetparsermacros
///\
addto
group packetparsermacros
///\{
///\name Control information
...
...
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