BDE 4.39.x Production Release
Loading...
Searching...
No Matches
balb_pipecontrolchannel.h
Go to the documentation of this file.
1/// @file balb_pipecontrolchannel.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// balb_pipecontrolchannel.h -*-C++-*-
8#ifndef INCLUDED_BALB_PIPECONTROLCHANNEL
9#define INCLUDED_BALB_PIPECONTROLCHANNEL
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup balb_pipecontrolchannel balb_pipecontrolchannel
15/// @brief Provide a mechanism for reading control messages from a named pipe.
16/// @addtogroup bal
17/// @{
18/// @addtogroup balb
19/// @{
20/// @addtogroup balb_pipecontrolchannel
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#balb_pipecontrolchannel-purpose"> Purpose</a>
25/// * <a href="#balb_pipecontrolchannel-classes"> Classes </a>
26/// * <a href="#balb_pipecontrolchannel-description"> Description </a>
27/// * <a href="#balb_pipecontrolchannel-thread-safety"> Thread Safety </a>
28/// * <a href="#balb_pipecontrolchannel-pipe-atomicity"> Pipe Atomicity </a>
29/// * <a href="#balb_pipecontrolchannel-pipe-names"> Pipe Names </a>
30/// * <a href="#balb_pipecontrolchannel-message-format"> Message Format </a>
31/// * <a href="#balb_pipecontrolchannel-pipe-permissions"> Pipe Permissions </a>
32/// * <a href="#balb_pipecontrolchannel-platform-specific-pipe-name-encoding-caveats"> Platform-Specific Pipe Name Encoding Caveats </a>
33/// * <a href="#balb_pipecontrolchannel-usage"> Usage </a>
34/// * <a href="#balb_pipecontrolchannel-example-1-controlling-a-simple-server"> Example 1: Controlling a Simple Server </a>
35///
36/// # Purpose {#balb_pipecontrolchannel-purpose}
37/// Provide a mechanism for reading control messages from a named pipe.
38///
39/// # Classes {#balb_pipecontrolchannel-classes}
40///
41/// - balb::PipeControlChannel: Mechanism for reading messages from a named pipe
42///
43/// @see bdls_pipeutil
44///
45/// # Description {#balb_pipecontrolchannel-description}
46/// This component provides a platform-independent mechanism,
47/// `balb::PipeControlChannel`, for establishing, monitoring, and shutting down
48/// a named pipe. It reads text messages (generally short operational commands)
49/// from the pipe and passes them to a callback function. Note that this
50/// component does *not* provide a general transport mechanism over a named
51/// pipe: it is specialized for the case that the messages to be read are
52/// relatively short newline-terminated strings.
53///
54/// ## Thread Safety {#balb_pipecontrolchannel-thread-safety}
55///
56///
57/// This component is thread-safe but not thread-enabled, meaning that multiple
58/// threads may safely use their own instances of PipeControlChannel, but may
59/// not manipulate the same PipeControlChannel simultaneously (except that
60/// `shutdown` may always be called safely). The `start` function creates a
61/// new thread which listens to the pipe for messages until `shutdown` is
62/// called.
63///
64/// ### Pipe Atomicity {#balb_pipecontrolchannel-pipe-atomicity}
65///
66///
67/// Users that expect multiple concurrent writers to a single pipe must be aware
68/// that the message content might be corrupted (interleaved) unless:
69///
70/// 1. Each message is written to the pipe in a single `write` system call.
71/// 2. The length of each message is less than `PIPE_BUF` (the limit for
72/// guaranteed atomicity).
73///
74/// The value `PIPE_BUF` depends on the platform:
75/// @code
76/// +------------------------------+------------------+
77/// | Platform | PIPE_BUF (bytes) |
78/// +------------------------------+------------------+
79/// | POSIX (minimum requirement)) | 512 |
80/// | IBM | 32,768 |
81/// | SUN | 32,768 |
82/// | Linux | 65,536 |
83/// | Windows | 65,536 |
84/// +------------------------------+------------------+
85/// @endcode
86///
87/// Also note that Linux allows the `PIPE_BUF` size to be changed via the
88/// `fcntl` system call.
89///
90/// ## Pipe Names {#balb_pipecontrolchannel-pipe-names}
91///
92///
93/// This component requires a fully-qualified native pipe name.
94/// `bdlsu::PipeUtil` provides a portable utility method to generate such names.
95///
96/// ## Message Format {#balb_pipecontrolchannel-message-format}
97///
98///
99/// This component requires a trailing newline ('\n') character at the end of
100/// each message. This trailing newline is stripped from the message before
101/// the message is passed to the control callback.
102///
103/// ## Pipe Permissions {#balb_pipecontrolchannel-pipe-permissions}
104///
105///
106/// This component creates its underlying named pipe with a permission bit
107/// mask that defaults to `k_DEFAULT_PERMISSIONS` (`0666`, i.e., read and write
108/// for owner, group, and others). A different permission bit mask may be
109/// supplied at construction time via the constructor overload taking an
110/// `int permissions` argument, or may be changed after construction (but before
111/// `start`) by calling `setPermissions`. The bit-mask semantics follow the
112/// conventional Unix mode-bit layout enumerated by `bdls::FilePermissions`;
113/// callers may express the desired permissions either as an octal literal
114/// (e.g., `0640`) or by OR-ing together `bdls::FilePermissions` enumerators
115/// (e.g., `bdls::FilePermissions::k_OWNER_READ | ...`). Only the nine
116/// owner/group/others read/write/execute bits are accepted (see
117/// `bdls::FilePermissions::isValidBaseBits`); `k_SET_UID`, `k_SET_GID`, and
118/// `k_STICKY_BIT` are not meaningful for a control pipe and result in
119/// undefined behavior.
120///
121/// On operating systems that do not support Unix-style permission bits
122/// (notably Windows) the requested permission bit mask is silently ignored
123/// and the pipe is created with the operating-system default permissions.
124///
125/// ## Platform-Specific Pipe Name Encoding Caveats {#balb_pipecontrolchannel-platform-specific-pipe-name-encoding-caveats}
126///
127///
128/// Pipe-name encodings have the following caveats for the following operating
129/// systems:
130///
131/// * On Windows, methods of `balb::PipeControlChannel` that take or return a
132/// pipe name as `bsl::string` (or a reference to it) type assume that the
133/// name is encoded in UTF-8. The routines attempt to convert the name to a
134/// UTF-16 `wchar_t` string via `bdlde::CharConvertUtf16::utf8ToUtf16`, and
135/// if the conversion succeeds, call the Windows wide-character `W` APIs with
136/// the UTF-16 name. If the conversion fails, the method fails.
137/// - Narrow-character pipe names in other encodings, containing characters
138/// with values in the range 128 - 255, will likely result in pipes being
139/// created with names that appear garbled if the conversion from UTF-8 to
140/// UTF-16 happens to succeed.
141/// - Neither `utf8ToUtf16` nor the Windows `W` APIs do any normalization of
142/// the UTF-16 strings resulting from UTF-8 conversion, and it is therefore
143/// possible to have sets of pipe names that have the same visual
144/// representation but are treated as different names by the system.
145/// * On Posix, a pipe name supplied to methods of `balb::PipeControlChannel`
146/// as `bsl::string` type is passed unchanged to the underlying system file
147/// APIs. Because the pipe names are passed unchanged,
148/// `balb::PipeControlChannel` methods will work correctly on Posix with any
149/// encoding, but will *interoperate* only with processes that use the same
150/// encoding as the current process.
151/// * For compatibility with most modern Posix installs, and consistency with
152/// this component's Windows API, best practice is to encode all pipe names
153/// in UTF-8.
154///
155/// ## Usage {#balb_pipecontrolchannel-usage}
156///
157///
158/// This section illustrates intended use of this component.
159///
160/// ### Example 1: Controlling a Simple Server {#balb_pipecontrolchannel-example-1-controlling-a-simple-server}
161///
162///
163/// This example illustrates how to construct a simple server that records
164/// messages sent on a pipe control channel until "EXIT" is received, at which
165/// point the channel is closed and the server stops.
166///
167/// First, let's define the implementation of our server.
168/// @code
169/// // ===================
170/// // class ControlServer
171/// // ===================
172///
173/// class ControlServer {
174///
175/// // DATA
176/// balb::PipeControlChannel d_channel;
177/// bsl::vector<bsl::string> d_messages;
178///
179/// // PRIVATE MANIPULATORS
180/// void onMessage(const bslstl::StringRef& message)
181/// {
182/// if ("EXIT" != message) {
183/// d_messages.push_back(message);
184/// }
185/// else {
186/// shutdown();
187/// }
188/// }
189///
190/// private:
191/// // NOT IMPLEMENTED
192/// ControlServer(const ControlServer&); // = delete
193/// ControlServer& operator=(const ControlServer&); // = delete
194///
195/// public:
196/// // CREATORS
197/// explicit ControlServer(bslma::Allocator *basicAllocator = 0)
198/// : d_channel(bdlf::BindUtil::bind(&ControlServer::onMessage,
199/// this,
200/// bdlf::PlaceHolders::_1),
201/// basicAllocator)
202/// , d_messages(basicAllocator)
203/// {}
204///
205/// // MANIPULATORS
206/// int start(const bslstl::StringRef& pipeName)
207/// {
208/// return d_channel.start(pipeName);
209/// }
210///
211/// void shutdown()
212/// {
213/// d_channel.shutdown();
214/// }
215///
216/// void stop()
217/// {
218/// d_channel.stop();
219/// }
220///
221/// // ACCESSORS
222/// bsl::size_t numMessages() const
223/// {
224/// return d_messages.size();
225/// }
226///
227/// const bsl::string& message(int index) const
228/// {
229/// return d_messages[index];
230/// }
231/// };
232/// @endcode
233/// Now, construct and run the server using a canonical name for the pipe:
234/// @code
235/// bsl::string pipeName;
236/// int rc = bdls::PipeUtil::makeCanonicalName(&pipeName,
237/// "ctrl.pcctest");
238/// assert(0 == rc);
239///
240/// ControlServer server;
241///
242/// rc = server.start(pipeName);
243/// if (0 != rc) {
244/// cout << "ERROR: Failed to start pipe control channel" << endl;
245/// }
246/// @endcode
247/// Once the server is started, clients can send messages to the server.
248/// @code
249/// const char MSG0[] = "this is the first message";
250/// const char MSG1[] = "this is the second message";
251///
252/// rc = bdls::PipeUtil::send(pipeName, bsl::string(MSG0) + "\n");
253/// assert(0 == rc);
254/// rc = bdls::PipeUtil::send(pipeName, bsl::string(MSG1) + "\n");
255/// assert(0 == rc);
256/// rc = bdls::PipeUtil::send(pipeName, "EXIT\n");
257/// assert(0 == rc);
258/// @endcode
259/// The server shuts down once it processes the "EXIT" control message.
260/// @code
261/// server.stop(); // block until shutdown
262/// @endcode
263/// Finally, let's ensure the server received each control message sent.
264/// @code
265/// assert(2 == server.numMessages());
266/// assert(bsl::string(MSG0) == server.message(0));
267/// assert(bsl::string(MSG1) == server.message(1));
268/// @endcode
269/// @}
270/** @} */
271/** @} */
272
273/** @addtogroup bal
274 * @{
275 */
276/** @addtogroup balb
277 * @{
278 */
279/** @addtogroup balb_pipecontrolchannel
280 * @{
281 */
282
283#include <balscm_version.h>
284
285#include <bdls_filepermissions.h>
286
288#include <bslmt_threadutil.h>
289
290#include <bslmf_assert.h>
291
292#include <bsls_atomic.h>
293#include <bsls_libraryfeatures.h>
294
295#include <bsl_functional.h>
296#include <bsl_string.h>
297#include <bsl_vector.h>
298
299#include <bslma_allocator.h>
300
301#include <string> // 'std::string', 'std::pmr::string'
302
303
304namespace balb {
305 // ========================
306 // class PipeControlChannel
307 // ========================
308
309/// This class is a mechanism for reading control messages from a named
310/// pipe. Use `start` to spawn a thread that handles messages arriving at
311/// the pipe, and `shutdown` to stop reading. `stop` blocks until the
312/// processing thread has been terminated by a call to `shutdown` (either
313/// before `stop` is called, or from some other thread).
314///
315/// See @ref balb_pipecontrolchannel
317
318 public:
319 // TYPES
320
321 /// This type of function is called to handle control messages received
322 /// on the pipe. The `message` is one complete message read from the
323 /// pipe, without the terminating newline character.
324 typedef bsl::function<void(const bslstl::StringRef& message)>
326
327 // CONSTANTS
328
329 /// The default permission bit mask for the underlying named pipe
330 /// (read/write for owner, group, and others).
331 static const int k_DEFAULT_PERMISSIONS =
338 private:
339 // TYPES
340 enum BackgroundThreadState {
341 e_STOPPED, // The background thread is not running or about to exit.
342 e_RUNNING, // The background thread is running normally.
343 e_STOPPING // The background thread is requested to stop.
344 };
345
346 // INSTANCE DATA
347 ControlCallback d_callback; // callback for control messages
348 bsl::string d_pipeName; // full path name of pipe
349 bsl::vector<char> d_buffer; // message buffer
350 bslmt::ThreadUtil::Handle d_thread; // background processing thread
351 bsls::AtomicInt d_backgroundState; // the background thread state
352 int d_permissions; // permission bit mask for the
353 // created named pipe (see
354 // @ref bdls_filepermissions );
355 // ignored on Windows
356 bool d_isPipeOpen; // true if the pipe is still open
357
358 union {
359 struct {
360 int d_readFd; // fifo descriptor (read-only)
361 int d_writeFd; // fifo descriptor (write-only)
363
364 struct {
365 void* d_handle; // pipe handle
367
368 } d_impl; // platform-specific imp
369
370 // PRIVATE MANIPULATORS
371
372 /// Loop while d_isRunningFlag is true, reading and dispatching messages
373 /// from the named pipe.
374 void backgroundProcessor();
375
376 /// Open a named pipe having the specified `pipeName`. Return 0 on
377 /// success, and a non-zero value otherwise.
378 int createNamedPipe(const char *pipeName);
379
380 /// Dispatch the message that extends up to (but not including) the
381 /// specified `iter` (which is an iterator into `d_buffer`), then erase
382 /// the prefix that extends up to (and including) `iter`.
383 void dispatchMessageUpTo(const bsl::vector<char>::iterator& iter);
384
385 /// If there is a newline character in `d_buffer`, call
386 /// `dispatchMessageUpTo` with the location of that newline character
387 /// and return `true`; otherwise, return `false`.
388 bool dispatchLeftoverMessage();
389
390 /// Close the named pipe.
391 void destroyNamedPipe();
392
393 /// Block until bytes are available on the named pipe, and read them
394 /// into the internal buffer. If a message is encountered, dispatch it.
395 /// Return 0 on success, and a non-zero value otherwise.
396 int readNamedPipe();
397
398 /// Writes a `\n` character, only, to the pipe. Returns 0 on success, a
399 /// value greater than 0 on error, and a value less than 0 in case of a
400 /// timeout. Used to unblock the reading thread so it can detect a shutdown condition.
401 ///
402 /// \note Note that this method is not to be called
403 /// anywhere except from `shutdown`.
404 int sendEmptyMessage();
405
406 private:
407 // NOT IMPLEMENTED
408 PipeControlChannel(const PipeControlChannel&);
409 PipeControlChannel& operator=(const PipeControlChannel&);
410
411 public:
412 // CREATORS
413
414 /// Create a pipe control mechanism that dispatches messages to the
415 /// specified `callback`. Optionally specify `basicAllocator` to supply
416 /// memory. If `basicAllocator` is zero, the currently installed default
417 /// allocator is used. The permission bit mask of the underlying named
418 /// pipe defaults to `k_DEFAULT_PERMISSIONS` (0666, i.e., read/write for
419 /// everyone) and may be changed by calling `setPermissions` before
420 /// `start`.
421 explicit
423 bslma::Allocator *basicAllocator = 0);
424
425 /// Create a pipe control mechanism that dispatches messages to the
426 /// specified `callback` and creates its underlying named pipe with the
427 /// specified `permissions` bit mask. Optionally specify
428 /// `basicAllocator` to supply memory. If `basicAllocator` is zero, the
429 /// currently installed default allocator is used.
430 ///
431 /// \pre The behavior is undefined unless `bdls::FilePermissions::isValidBaseBits(permissions)`
432 /// (i.e., unless `permissions` is a combination of the nine
433 /// owner/group/others read/write/execute bits defined by
434 /// `bdls::FilePermissions`; note that `k_SET_UID`, `k_SET_GID`, and
435 /// `k_STICKY_BIT` are not accepted). On operating systems that do not
436 /// support Unix-style permission bits (notably Windows) the value is
437 /// ignored and falls back to the operating-system default (see the
438 /// component-level documentation for details).
440 int permissions,
441 bslma::Allocator *basicAllocator = 0);
442
443 /// Destroy this object. Shut down the processing thread if it is still
444 /// running and block until it terminates. Close the named pipe and
445 /// clean up any associated system resources.
447
448 // MANIPULATORS
449
450 /// Set the permission bit mask for the underlying named pipe to the specified `permissions` value.
451 ///
452 /// \pre The behavior is undefined unless
453 /// `bdls::FilePermissions::isValidBaseBits(permissions)`. This setting
454 /// only takes effect on the next call to `start`; calling this method
455 /// has no effect on a pipe that has already been opened. See the
456 /// class-level documentation for a description of the cross-platform semantics.
457 ///
458 /// \pre The behavior is undefined if this method is called while
459 /// the background thread is running (i.e., after `start` and before
460 /// `shutdown`), or if the `permissions` value is not valid.
462
463 /// Open a named pipe having the specified `pipeName`, and start a
464 /// thread to read messages and dispatch them to the callback specified
465 /// at construction. Optionally specify `attributes` of the background
466 /// processing thread. If `attributes` is not supplied, a default
467 /// constructed `ThreadAttributes` object will be used. Return 0 on
468 /// success, and a non-zero value otherwise. In particular, return a
469 /// non-zero value if the pipe cannot be opened or if it is detected
470 /// that another process is reading from the pipe. `pipeName` must be
471 /// of the types `const char *`, `char *`, `bsl::string`, `std::string`,
472 /// `std::pmr::string` (if supported), or `bslstl::StringRef`.
473 int start(const char *pipeName);
474 template <class STRING_TYPE>
475 int start(const STRING_TYPE& pipeName);
476 int start(const char *pipeName,
477 const bslmt::ThreadAttributes& attributes);
478 template <class STRING_TYPE>
479 int start(const STRING_TYPE& pipeName,
480 const bslmt::ThreadAttributes& attributes);
481
482 /// Stop reading from the pipe and dispatching messages. If the
483 /// background thread has begun processing a message, this method will
484 /// block until a message that is currently being processed completes.
485 void shutdown();
486
487 /// Block until the background thread has been terminated by a call to
488 /// `shutdown`. Then close the pipe and clean up the associated file.
489 void stop();
490
491 // ACCESSORS
492
493 /// Return the permission bit mask that will be applied to the named
494 /// pipe on the next call to `start`.
495 int permissions() const;
496
497 /// Return the fully qualified system name of the pipe.
498 const bsl::string& pipeName() const;
499
500 // Aspects
501
502 /// Return the allocator used by this object to supply memory.
503 ///
504 /// \note Note that if no allocator was supplied at construction the default
505 /// allocator in effect at construction is used.
507};
508
509 // ====================================
510 // class PipeControlChannel_CStringUtil
511 // ====================================
512
513/// This component-private utility `struct` provides a namespace for the
514/// `flatten` overload set intended to be used in concert with an overload
515/// set consisting of a function template with a deduced argument and an
516/// non-template overload accepting a `const char *`. The actual
517/// implementation of the functionality would be in the `const char *`
518/// overload whereas the purpose of the function template is to invoke the
519/// `const char *` overload with a null-terminated string.
520///
521/// The function template achieves null-termination by recursively calling
522/// the function and supplying it with the result of `flatten` invoked on
523/// the deduced argument. This `flatten` invocation will call `c_str()` on
524/// various supported `string` types, will produce a temporary `bsl::string`
525/// for possibly non-null-terminated `bslstl::StringRef`, and will result in
526/// a `BSLMF_ASSERT` for any unsupported type. Calling the function with
527/// the temporary `bsl::string` produced from `bslstl::StringRef` will
528/// result in a second invocation of `flatten`, this time producing
529/// `const char *`, and finally calling the function with a null-terminated
530/// string.
531///
532///
533/// \note Note that the `bslstl::StringRef` overload for `flatten` is provided for
534/// backwards compatibility. Without it, the `bsl::string` and
535/// `std::string` overloads would be ambiguous. In new code, it is
536/// preferable to not provide `bslstl::StringRef` overload in a similar
537/// facility and require the clients to explicitly state the string type in
538/// their code, making a potential allocation obvious. The
539/// `bsl::string_view` overload is not provided for the same reason.
540///
541/// Also note that since the constructor for `string` types from
542/// `bsl::string_view` is explicit, it is not necessary to support
543/// `bsl::string_view` for backwards compatibility, and it is not supported.
544///
545/// See @ref balb_pipecontrolchannel
547
548 // CLASS METHODS
549
550 /// Return the specified `cString`.
551 static const char *flatten(char *cString);
552 static const char *flatten(const char *cString);
553
554 static const char *flatten(const bsl::string& string);
555 static const char *flatten(const std::string& string);
556#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
557 static const char *flatten(const std::pmr::string& string);
558#endif
559 // Return the result of invoking 'c_str()' on the specified 'string'.
560
561 /// Return a temporary `bsl::string` constructed from the specified
562 /// `stringRef`.
563 static bsl::string flatten(const bslstl::StringRef& stringRef);
564
565 /// Produce a compile-time error informing the caller that the
566 /// parameterized `TYPE` is not supported as the parameter for the call.
567 template <class TYPE>
568 static const char *flatten(const TYPE&);
569};
570
571// ============================================================================
572// INLINE DEFINITIONS
573// ============================================================================
574
575 // ------------------------
576 // class PipeControlChannel
577 // ------------------------
578
579// MANIPULATORS
580template <class STRING_TYPE>
586
587template <class STRING_TYPE>
588int PipeControlChannel::start(const STRING_TYPE& pipeName,
589 const bslmt::ThreadAttributes& threadAttributes)
590{
592 threadAttributes);
593}
594
595// ACCESSORS
596inline
598{
599 return d_permissions;
600}
601
602inline
604{
605 return d_pipeName;
606}
607
608 // Aspects
609
610inline
612{
613 return d_pipeName.get_allocator().mechanism();
614}
615
616 // ------------------------------------
617 // class PipeControlChannel_CStringUtil
618 // ------------------------------------
619
620// CLASS METHODS
621inline
623{
624 return cString;
625}
626
627inline
628const char *PipeControlChannel_CStringUtil::flatten(const char *cString)
629{
630 return cString;
631}
632
633inline
635{
636 return string.c_str();
637}
638
639inline
640const char *PipeControlChannel_CStringUtil::flatten(const std::string& string)
641{
642 return string.c_str();
643}
644
645#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
646inline
648 const std::pmr::string& string)
649{
650 return string.c_str();
651}
652#endif
653
654inline
656 const bslstl::StringRef& stringRef)
657{
658 return stringRef;
659}
660
661template <class TYPE>
662inline
664{
665 BSLMF_ASSERT(("Unsupported parameter type." && !sizeof(TYPE)));
666 return 0;
667}
668
669} // close package namespace
670
671#endif
672
673// ----------------------------------------------------------------------------
674// Copyright 2017 Bloomberg Finance L.P.
675//
676// Licensed under the Apache License, Version 2.0 (the "License");
677// you may not use this file except in compliance with the License.
678// You may obtain a copy of the License at
679//
680// http://www.apache.org/licenses/LICENSE-2.0
681//
682// Unless required by applicable law or agreed to in writing, software
683// distributed under the License is distributed on an "AS IS" BASIS,
684// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
685// See the License for the specific language governing permissions and
686// limitations under the License.
687// ----------------------------- END-OF-FILE ----------------------------------
688
689/** @} */
690/** @} */
691/** @} */
Definition balb_pipecontrolchannel.h:316
int d_readFd
Definition balb_pipecontrolchannel.h:360
void setPermissions(int permissions)
int d_writeFd
Definition balb_pipecontrolchannel.h:361
static const int k_DEFAULT_PERMISSIONS
Definition balb_pipecontrolchannel.h:331
struct balb::PipeControlChannel::@0::@2 d_windows
PipeControlChannel(const ControlCallback &callback, bslma::Allocator *basicAllocator=0)
const bsl::string & pipeName() const
Return the fully qualified system name of the pipe.
Definition balb_pipecontrolchannel.h:603
int start(const char *pipeName)
int start(const char *pipeName, const bslmt::ThreadAttributes &attributes)
void * d_handle
Definition balb_pipecontrolchannel.h:365
bslma::Allocator * allocator() const
Definition balb_pipecontrolchannel.h:611
int permissions() const
Definition balb_pipecontrolchannel.h:597
struct balb::PipeControlChannel::@0::@1 d_unix
bsl::function< void(const bslstl::StringRef &message)> ControlCallback
Definition balb_pipecontrolchannel.h:325
PipeControlChannel(const ControlCallback &callback, int permissions, bslma::Allocator *basicAllocator=0)
Definition bslstl_string.h:1252
allocator_type get_allocator() const BSLS_KEYWORD_NOEXCEPT
Return the allocator used by this string to supply memory.
Definition bslstl_string.h:7423
Forward declaration.
Definition bslstl_function.h:946
Definition bslstl_vector.h:1120
VALUE_TYPE * iterator
Definition bslstl_vector.h:1152
Definition bslma_allocator.h:545
Definition bslmt_threadattributes.h:361
Definition bsls_atomic.h:744
Definition bslstl_stringref.h:374
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:231
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition balb_controlmanager.h:144
Definition balb_pipecontrolchannel.h:546
static const char * flatten(char *cString)
Return the specified cString.
Definition balb_pipecontrolchannel.h:622
@ k_GROUP_READ
Definition bdls_filepermissions.h:162
@ k_OWNER_READ
Definition bdls_filepermissions.h:157
@ k_OTHERS_WRITE
Definition bdls_filepermissions.h:168
@ k_OWNER_WRITE
Definition bdls_filepermissions.h:158
@ k_OTHERS_READ
Definition bdls_filepermissions.h:167
@ k_GROUP_WRITE
Definition bdls_filepermissions.h:163
Imp::Handle Handle
Definition bslmt_threadutil.h:389