Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
b35c08be
Commit
b35c08be
authored
Sep 26, 2013
by
Martin Hurton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename engine's methods to improve code readability
parent
63e0fe91
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
33 deletions
+33
-33
i_engine.hpp
src/i_engine.hpp
+2
-2
pgm_receiver.cpp
src/pgm_receiver.cpp
+2
-2
pgm_receiver.hpp
src/pgm_receiver.hpp
+2
-2
pgm_sender.cpp
src/pgm_sender.cpp
+2
-2
pgm_sender.hpp
src/pgm_sender.hpp
+2
-2
session_base.cpp
src/session_base.cpp
+2
-2
stream_engine.cpp
src/stream_engine.cpp
+17
-17
stream_engine.hpp
src/stream_engine.hpp
+4
-4
No files found.
src/i_engine.hpp
View file @
b35c08be
...
@@ -41,11 +41,11 @@ namespace zmq
...
@@ -41,11 +41,11 @@ namespace zmq
// This method is called by the session to signalise that more
// This method is called by the session to signalise that more
// messages can be written to the pipe.
// messages can be written to the pipe.
virtual
void
activate_in
()
=
0
;
virtual
void
restart_input
()
=
0
;
// This method is called by the session to signalise that there
// This method is called by the session to signalise that there
// are messages to send available.
// are messages to send available.
virtual
void
activate_o
ut
()
=
0
;
virtual
void
restart_outp
ut
()
=
0
;
virtual
void
zap_msg_available
()
=
0
;
virtual
void
zap_msg_available
()
=
0
;
};
};
...
...
src/pgm_receiver.cpp
View file @
b35c08be
...
@@ -102,12 +102,12 @@ void zmq::pgm_receiver_t::terminate ()
...
@@ -102,12 +102,12 @@ void zmq::pgm_receiver_t::terminate ()
delete
this
;
delete
this
;
}
}
void
zmq
::
pgm_receiver_t
::
activate_o
ut
()
void
zmq
::
pgm_receiver_t
::
restart_outp
ut
()
{
{
drop_subscriptions
();
drop_subscriptions
();
}
}
void
zmq
::
pgm_receiver_t
::
activate_in
()
void
zmq
::
pgm_receiver_t
::
restart_input
()
{
{
zmq_assert
(
session
!=
NULL
);
zmq_assert
(
session
!=
NULL
);
zmq_assert
(
active_tsi
!=
NULL
);
zmq_assert
(
active_tsi
!=
NULL
);
...
...
src/pgm_receiver.hpp
View file @
b35c08be
...
@@ -57,8 +57,8 @@ namespace zmq
...
@@ -57,8 +57,8 @@ namespace zmq
void
plug
(
zmq
::
io_thread_t
*
io_thread_
,
void
plug
(
zmq
::
io_thread_t
*
io_thread_
,
zmq
::
session_base_t
*
session_
);
zmq
::
session_base_t
*
session_
);
void
terminate
();
void
terminate
();
void
activate_in
();
void
restart_input
();
void
activate_o
ut
();
void
restart_outp
ut
();
void
zap_msg_available
()
{}
void
zap_msg_available
()
{}
// i_poll_events interface implementation.
// i_poll_events interface implementation.
...
...
src/pgm_sender.cpp
View file @
b35c08be
...
@@ -119,13 +119,13 @@ void zmq::pgm_sender_t::terminate ()
...
@@ -119,13 +119,13 @@ void zmq::pgm_sender_t::terminate ()
delete
this
;
delete
this
;
}
}
void
zmq
::
pgm_sender_t
::
activate_o
ut
()
void
zmq
::
pgm_sender_t
::
restart_outp
ut
()
{
{
set_pollout
(
handle
);
set_pollout
(
handle
);
out_event
();
out_event
();
}
}
void
zmq
::
pgm_sender_t
::
activate_in
()
void
zmq
::
pgm_sender_t
::
restart_input
()
{
{
zmq_assert
(
false
);
zmq_assert
(
false
);
}
}
...
...
src/pgm_sender.hpp
View file @
b35c08be
...
@@ -56,8 +56,8 @@ namespace zmq
...
@@ -56,8 +56,8 @@ namespace zmq
void
plug
(
zmq
::
io_thread_t
*
io_thread_
,
void
plug
(
zmq
::
io_thread_t
*
io_thread_
,
zmq
::
session_base_t
*
session_
);
zmq
::
session_base_t
*
session_
);
void
terminate
();
void
terminate
();
void
activate_in
();
void
restart_input
();
void
activate_o
ut
();
void
restart_outp
ut
();
void
zap_msg_available
()
{}
void
zap_msg_available
()
{}
// i_poll_events interface implementation.
// i_poll_events interface implementation.
...
...
src/session_base.cpp
View file @
b35c08be
...
@@ -243,7 +243,7 @@ void zmq::session_base_t::read_activated (pipe_t *pipe_)
...
@@ -243,7 +243,7 @@ void zmq::session_base_t::read_activated (pipe_t *pipe_)
}
}
if
(
likely
(
pipe_
==
pipe
))
if
(
likely
(
pipe_
==
pipe
))
engine
->
activate_o
ut
();
engine
->
restart_outp
ut
();
else
else
engine
->
zap_msg_available
();
engine
->
zap_msg_available
();
}
}
...
@@ -257,7 +257,7 @@ void zmq::session_base_t::write_activated (pipe_t *pipe_)
...
@@ -257,7 +257,7 @@ void zmq::session_base_t::write_activated (pipe_t *pipe_)
}
}
if
(
engine
)
if
(
engine
)
engine
->
activate_in
();
engine
->
restart_input
();
}
}
void
zmq
::
session_base_t
::
hiccuped
(
pipe_t
*
)
void
zmq
::
session_base_t
::
hiccuped
(
pipe_t
*
)
...
...
src/stream_engine.cpp
View file @
b35c08be
...
@@ -74,8 +74,8 @@ zmq::stream_engine_t::stream_engine_t (fd_t fd_, const options_t &options_,
...
@@ -74,8 +74,8 @@ zmq::stream_engine_t::stream_engine_t (fd_t fd_, const options_t &options_,
io_error
(
false
),
io_error
(
false
),
subscription_required
(
false
),
subscription_required
(
false
),
mechanism
(
NULL
),
mechanism
(
NULL
),
input_
paus
ed
(
false
),
input_
stopp
ed
(
false
),
output_
paus
ed
(
false
),
output_
stopp
ed
(
false
),
socket
(
NULL
)
socket
(
NULL
)
{
{
int
rc
=
tx_msg
.
init
();
int
rc
=
tx_msg
.
init
();
...
@@ -204,7 +204,7 @@ void zmq::stream_engine_t::in_event ()
...
@@ -204,7 +204,7 @@ void zmq::stream_engine_t::in_event ()
zmq_assert
(
decoder
);
zmq_assert
(
decoder
);
// If there has been an I/O error, stop polling.
// If there has been an I/O error, stop polling.
if
(
input_
paus
ed
)
{
if
(
input_
stopp
ed
)
{
rm_fd
(
handle
);
rm_fd
(
handle
);
io_error
=
true
;
io_error
=
true
;
return
;
return
;
...
@@ -252,7 +252,7 @@ void zmq::stream_engine_t::in_event ()
...
@@ -252,7 +252,7 @@ void zmq::stream_engine_t::in_event ()
error
();
error
();
return
;
return
;
}
}
input_
paus
ed
=
true
;
input_
stopp
ed
=
true
;
reset_pollin
(
handle
);
reset_pollin
(
handle
);
}
}
...
@@ -291,7 +291,7 @@ void zmq::stream_engine_t::out_event ()
...
@@ -291,7 +291,7 @@ void zmq::stream_engine_t::out_event ()
// If there is no data to send, stop polling for output.
// If there is no data to send, stop polling for output.
if
(
outsize
==
0
)
{
if
(
outsize
==
0
)
{
output_
paus
ed
=
true
;
output_
stopp
ed
=
true
;
reset_pollout
(
handle
);
reset_pollout
(
handle
);
return
;
return
;
}
}
...
@@ -328,14 +328,14 @@ void zmq::stream_engine_t::out_event ()
...
@@ -328,14 +328,14 @@ void zmq::stream_engine_t::out_event ()
terminate
();
terminate
();
}
}
void
zmq
::
stream_engine_t
::
activate_o
ut
()
void
zmq
::
stream_engine_t
::
restart_outp
ut
()
{
{
if
(
unlikely
(
io_error
))
if
(
unlikely
(
io_error
))
return
;
return
;
if
(
likely
(
output_
paus
ed
))
{
if
(
likely
(
output_
stopp
ed
))
{
set_pollout
(
handle
);
set_pollout
(
handle
);
output_
paus
ed
=
false
;
output_
stopp
ed
=
false
;
}
}
// Speculative write: The assumption is that at the moment new message
// Speculative write: The assumption is that at the moment new message
...
@@ -345,9 +345,9 @@ void zmq::stream_engine_t::activate_out ()
...
@@ -345,9 +345,9 @@ void zmq::stream_engine_t::activate_out ()
out_event
();
out_event
();
}
}
void
zmq
::
stream_engine_t
::
activate_in
()
void
zmq
::
stream_engine_t
::
restart_input
()
{
{
zmq_assert
(
input_
paus
ed
);
zmq_assert
(
input_
stopp
ed
);
zmq_assert
(
session
!=
NULL
);
zmq_assert
(
session
!=
NULL
);
zmq_assert
(
decoder
!=
NULL
);
zmq_assert
(
decoder
!=
NULL
);
...
@@ -379,7 +379,7 @@ void zmq::stream_engine_t::activate_in ()
...
@@ -379,7 +379,7 @@ void zmq::stream_engine_t::activate_in ()
if
(
rc
==
-
1
||
io_error
)
if
(
rc
==
-
1
||
io_error
)
error
();
error
();
else
{
else
{
input_
paus
ed
=
false
;
input_
stopp
ed
=
false
;
set_pollin
(
handle
);
set_pollin
(
handle
);
session
->
flush
();
session
->
flush
();
...
@@ -614,8 +614,8 @@ int zmq::stream_engine_t::process_handshake_command (msg_t *msg_)
...
@@ -614,8 +614,8 @@ int zmq::stream_engine_t::process_handshake_command (msg_t *msg_)
if
(
rc
==
0
)
{
if
(
rc
==
0
)
{
if
(
mechanism
->
is_handshake_complete
())
if
(
mechanism
->
is_handshake_complete
())
mechanism_ready
();
mechanism_ready
();
if
(
output_
paus
ed
)
if
(
output_
stopp
ed
)
activate_o
ut
();
restart_outp
ut
();
}
}
return
rc
;
return
rc
;
...
@@ -630,10 +630,10 @@ void zmq::stream_engine_t::zap_msg_available ()
...
@@ -630,10 +630,10 @@ void zmq::stream_engine_t::zap_msg_available ()
error
();
error
();
return
;
return
;
}
}
if
(
input_
paus
ed
)
if
(
input_
stopp
ed
)
activate_in
();
restart_input
();
if
(
output_
paus
ed
)
if
(
output_
stopp
ed
)
activate_o
ut
();
restart_outp
ut
();
}
}
void
zmq
::
stream_engine_t
::
mechanism_ready
()
void
zmq
::
stream_engine_t
::
mechanism_ready
()
...
...
src/stream_engine.hpp
View file @
b35c08be
...
@@ -60,8 +60,8 @@ namespace zmq
...
@@ -60,8 +60,8 @@ namespace zmq
void
plug
(
zmq
::
io_thread_t
*
io_thread_
,
void
plug
(
zmq
::
io_thread_t
*
io_thread_
,
zmq
::
session_base_t
*
session_
);
zmq
::
session_base_t
*
session_
);
void
terminate
();
void
terminate
();
void
activate_in
();
void
restart_input
();
void
activate_o
ut
();
void
restart_outp
ut
();
void
zap_msg_available
();
void
zap_msg_available
();
// i_poll_events interface implementation.
// i_poll_events interface implementation.
...
@@ -179,10 +179,10 @@ namespace zmq
...
@@ -179,10 +179,10 @@ namespace zmq
mechanism_t
*
mechanism
;
mechanism_t
*
mechanism
;
// True iff the engine couldn't consume the last decoded message.
// True iff the engine couldn't consume the last decoded message.
bool
input_
paus
ed
;
bool
input_
stopp
ed
;
// True iff the engine doesn't have any message to encode.
// True iff the engine doesn't have any message to encode.
bool
output_
paus
ed
;
bool
output_
stopp
ed
;
// Socket
// Socket
zmq
::
socket_base_t
*
socket
;
zmq
::
socket_base_t
*
socket
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment