NCBI C++ ToolKit
ncbi_pipe_connector.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef CONNECT___NCBI_PIPE_CONNECTOR__HPP
2 #define CONNECT___NCBI_PIPE_CONNECTOR__HPP
3 
4 /* $Id: ncbi_pipe_connector.hpp 101750 2024-02-07 00:04:44Z lavr $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Author: Vladimir Ivanov
30  *
31  *
32  */
33 
34 /// @file ncbi_pipe_connector.hpp
35 /// Implement CONNECTOR for a pipe interprocess communication
36 /// (based on the NCBI CPipe).
37 ///
38 /// See in "ncbi_connector.h" for the detailed specification of the underlying
39 /// connector(CONNECTOR, SConnectorTag) methods and structures.
40 
41 
42 #include <connect/ncbi_pipe.hpp>
43 #include <connect/ncbi_connector.h>
44 
45 
46 /** @addtogroup Connectors
47  *
48  * @{
49  */
50 
51 
53 
54 
55 /// Create CPipe-based CONNECTOR.
56 ///
57 /// Create new CONNECTOR structure to handle data transfer with a spawned
58 /// process (command) over an interprocess pipe. Return NULL on error.
59 ///
60 /// @param cmd
61 /// Command name to execute
62 /// @param args
63 /// Vector of string arguments for the command (argv[0] excluded)
64 /// @param flags
65 /// See CPipe::TCreateFlags
66 /// @param pipe
67 /// The connector is to be built on top of the specified CPipe (otherwise,
68 /// a CPipe oobject gets created internally)
69 /// @param own_pipe
70 /// Disposition of the "pipe" parameter when the connector gets destroyed
71 /// @param pipe_size
72 /// Internal buffer size (0 uses some reasonable default)
73 /// @sa
74 /// CPipe
76 (const string& cmd,
77  const vector<string>& args,
79  CPipe* pipe = 0,
80  EOwnership own_pipe = eTakeOwnership, /**< only if "pipe" given */
81  size_t pipe_size = 0 /**< use default */
82 );
83 
84 
86 
87 
88 /* @} */
89 
90 #endif /* CONNECT___NCBI_PIPE_CONNECTOR__HPP */
CPipe –.
Definition: ncbi_pipe.hpp:76
static uch flags
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
@ eTakeOwnership
An object can take ownership of another.
Definition: ncbi_types.h:136
CONNECTOR PIPE_CreateConnector(const string &cmd, const vector< string > &args, CPipe::TCreateFlags flags=0, CPipe *pipe=0, EOwnership own_pipe=eTakeOwnership, size_t pipe_size=0)
Create CPipe-based CONNECTOR.
unsigned int TCreateFlags
bitwise OR of "ECreateFlag"
Definition: ncbi_pipe.hpp:111
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
enum ENcbiOwnership EOwnership
Ownership relations between objects.
#define NCBI_XCONNECT_EXPORT
Portable class to work with a spawned process via pipes.
Connector specification.
Modified on Sun Apr 21 03:39:38 2024 by modify_doxy.py rev. 669887