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
cc813689
Commit
cc813689
authored
Sep 22, 2009
by
Martin Sustrik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
documentation in zmq.h improved
parent
e6ca5da1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
36 deletions
+5
-36
zmq.h
bindings/c/zmq.h
+0
-0
zmq.hpp
bindings/cpp/zmq.hpp
+0
-13
zmq.cpp
src/zmq.cpp
+5
-23
No files found.
bindings/c/zmq.h
View file @
cc813689
This diff is collapsed.
Click to expand it.
bindings/cpp/zmq.hpp
View file @
cc813689
...
...
@@ -32,13 +32,6 @@ namespace zmq
typedef
zmq_free_fn
free_fn
;
enum
message_type_t
{
message_data
=
1
<<
0
,
message_gap
=
1
<<
ZMQ_GAP
,
message_delimiter
=
1
<<
ZMQ_DELIMITER
};
// The class masquerades POSIX-style errno error as a C++ exception.
class
error_t
:
public
std
::
exception
{
...
...
@@ -148,12 +141,6 @@ namespace zmq
throw
error_t
();
}
// Returns message type.
inline
message_type_t
type
()
{
return
(
message_type_t
)
(
1
<<
zmq_msg_type
(
this
));
}
// Returns pointer to message's data buffer.
inline
void
*
data
()
{
...
...
src/zmq.cpp
View file @
cc813689
...
...
@@ -84,8 +84,7 @@ int zmq_msg_close (zmq_msg_t *msg_)
{
// For VSMs and delimiters there are no resources to free.
if
(
msg_
->
content
==
(
zmq
::
msg_content_t
*
)
ZMQ_DELIMITER
||
msg_
->
content
==
(
zmq
::
msg_content_t
*
)
ZMQ_VSM
||
msg_
->
content
==
(
zmq
::
msg_content_t
*
)
ZMQ_GAP
)
msg_
->
content
==
(
zmq
::
msg_content_t
*
)
ZMQ_VSM
)
return
0
;
// If the content is not shared, or if it is shared and the reference.
...
...
@@ -118,10 +117,8 @@ int zmq_msg_copy (zmq_msg_t *dest_, zmq_msg_t *src_)
zmq_msg_close
(
dest_
);
// VSMs and delimiters require no special handling.
if
(
src_
->
content
!=
(
zmq
::
msg_content_t
*
)
ZMQ_DELIMITER
&&
src_
->
content
!=
(
zmq
::
msg_content_t
*
)
ZMQ_VSM
&&
src_
->
content
!=
(
zmq
::
msg_content_t
*
)
ZMQ_GAP
)
{
if
(
src_
->
content
!=
(
zmq
::
msg_content_t
*
)
ZMQ_DELIMITER
&&
src_
->
content
!=
(
zmq
::
msg_content_t
*
)
ZMQ_VSM
)
{
// One reference is added to shared messages. Non-shared messages
// are turned into shared messages and reference count is set to 2.
...
...
@@ -142,9 +139,7 @@ void *zmq_msg_data (zmq_msg_t *msg_)
{
if
(
msg_
->
content
==
(
zmq
::
msg_content_t
*
)
ZMQ_VSM
)
return
msg_
->
vsm_data
;
if
(
msg_
->
content
==
(
zmq
::
msg_content_t
*
)
ZMQ_DELIMITER
||
msg_
->
content
==
(
zmq
::
msg_content_t
*
)
ZMQ_GAP
)
if
(
msg_
->
content
==
(
zmq
::
msg_content_t
*
)
ZMQ_DELIMITER
)
return
NULL
;
return
((
zmq
::
msg_content_t
*
)
msg_
->
content
)
->
data
;
...
...
@@ -154,25 +149,12 @@ size_t zmq_msg_size (zmq_msg_t *msg_)
{
if
(
msg_
->
content
==
(
zmq
::
msg_content_t
*
)
ZMQ_VSM
)
return
msg_
->
vsm_size
;
if
(
msg_
->
content
==
(
zmq
::
msg_content_t
*
)
ZMQ_DELIMITER
||
msg_
->
content
==
(
zmq
::
msg_content_t
*
)
ZMQ_GAP
)
if
(
msg_
->
content
==
(
zmq
::
msg_content_t
*
)
ZMQ_DELIMITER
)
return
0
;
return
((
zmq
::
msg_content_t
*
)
msg_
->
content
)
->
size
;
}
int
zmq_msg_type
(
zmq_msg_t
*
msg_
)
{
// If it's a genuine message, return 0.
if
(
msg_
->
content
>=
(
zmq
::
msg_content_t
*
)
ZMQ_VSM
)
return
0
;
// Trick the compiler to believe that content is an integer.
unsigned
char
*
offset
=
0
;
return
(((
const
unsigned
char
*
)
msg_
->
content
)
-
offset
);
}
void
*
zmq_init
(
int
app_threads_
,
int
io_threads_
,
int
flags_
)
{
// There should be at least a single thread managed by the dispatcher.
...
...
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