24
24
25
25
"""
26
26
High-level Message object for sending/receiving ZMQ messages in shared buffers.
27
-
28
- Message()
29
-
30
- Create an empty message (for receive).
31
-
32
- ---
33
-
34
- Message(len::Integer)
35
-
36
- Create a message with a given buffer size (for send).
37
-
38
- ---
39
-
40
- Message(origin::Any, m::Ptr{T}, len::Integer) where {T}
41
-
42
- Low-level function to create a message (for send) with an existing
43
- data buffer, without making a copy. The origin parameter should
44
- be the Julia object that is the origin of the data, so that
45
- we can hold a reference to it until ZMQ is done with the buffer.
46
-
47
- ---
48
-
49
- Message(m::String)
50
-
51
- Create a message with a string as a buffer (for send). Note: the Message now
52
- "owns" the string, it must not be resized, or even written to after the message
53
- is sent.
54
-
55
- ---
56
-
57
- Message(p::SubString{String})
58
-
59
- Create a message with a sub-string as a buffer (for send). Note: the same
60
- ownership semantics as for [`Message(m::String)`](@ref) apply.
61
-
62
- ---
63
-
64
- Message(a::Array)
65
-
66
- Create a message with an array as a buffer (for send). Note: the same
67
- ownership semantics as for [`Message(m::String)`](@ref) apply.
68
-
69
- ---
70
-
71
- Message(io::IOBuffer)
72
-
73
- Create a message with an
74
- [`IOBuffer`](https://docs.julialang.org/en/v1/base/io-network/#Base.IOBuffer) as
75
- a buffer (for send). Note: the same ownership semantics as for
76
- [`Message(m::String)`](@ref) apply.
77
27
"""
78
28
mutable struct Message <: AbstractArray{UInt8,1}
79
29
# Matching the declaration in the header: char _[64];
80
30
w_padding:: _Message
81
31
handle:: Ptr{Cvoid} # index into gc_protect, if any
82
32
83
- """
33
+ @doc """
84
34
Message()
85
35
86
36
Create an empty message (for receive).
@@ -96,7 +46,7 @@ mutable struct Message <: AbstractArray{UInt8,1}
96
46
return zmsg
97
47
end
98
48
99
- """
49
+ @doc """
100
50
Message(len::Integer)
101
51
102
52
Create a message with a given buffer size (for send).
@@ -112,7 +62,7 @@ mutable struct Message <: AbstractArray{UInt8,1}
112
62
return zmsg
113
63
end
114
64
115
- """
65
+ @doc """
116
66
Message(origin::Any, m::Ptr{T}, len::Integer) where {T}
117
67
118
68
Low-level function to create a message (for send) with an existing
@@ -134,7 +84,7 @@ mutable struct Message <: AbstractArray{UInt8,1}
134
84
return zmsg
135
85
end
136
86
137
- """
87
+ @doc """
138
88
Message(m::String)
139
89
140
90
Create a message with a string as a buffer (for send). Note: the Message now
@@ -143,7 +93,7 @@ mutable struct Message <: AbstractArray{UInt8,1}
143
93
"""
144
94
Message (m:: String ) = Message (m, pointer (m), sizeof (m))
145
95
146
- """
96
+ @doc """
147
97
Message(p::SubString{String})
148
98
149
99
Create a message with a sub-string as a buffer (for send). Note: the same
@@ -152,15 +102,15 @@ mutable struct Message <: AbstractArray{UInt8,1}
152
102
Message (p:: SubString{String} ) =
153
103
Message (p, pointer (p. string)+ p. offset, sizeof (p))
154
104
155
- """
105
+ @doc """
156
106
Message(a::Array)
157
107
158
108
Create a message with an array as a buffer (for send). Note: the same
159
109
ownership semantics as for [`Message(m::String)`](@ref) apply.
160
110
"""
161
111
Message (a:: Array ) = Message (a, pointer (a), sizeof (a))
162
112
163
- """
113
+ @doc """
164
114
Message(io::IOBuffer)
165
115
166
116
Create a message with an
0 commit comments