NCBI C++ ToolKit
ncbi_service_connector.h
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef CONNECT___NCBI_SERVICE_CONNECTOR__H
2 #define CONNECT___NCBI_SERVICE_CONNECTOR__H
3 
4 /* $Id: ncbi_service_connector.h 89758 2020-04-21 14:52:43Z 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: Anton Lavrentiev
30  *
31  * File Description:
32  * Implement CONNECTOR for a named NCBI service
33  *
34  * See in "ncbi_connector.h" for the detailed specification of the underlying
35  * connector("CONNECTOR", "SConnectorTag") methods and structures.
36  *
37  */
38 
40 #include <connect/ncbi_service.h>
41 
42 
43 /** @addtogroup Connectors
44  *
45  * @{
46  */
47 
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 
54 typedef void (*FSERVICE_Reset) (void* data);
55 typedef void (*FSERVICE_Cleanup) (void* data);
56 typedef const SSERV_Info* (*FSERVICE_GetNextInfo)(void* data, SERV_ITER iter);
57 
58 
59 typedef struct {
60  void* data; /* User-supplied callback data */
61  FSERVICE_Reset reset; /* Called prior to each iter reset */
62  FHTTP_Adjust adjust; /* Called when data source is HTTP(S)*/
63  FSERVICE_Cleanup cleanup; /* Called prior to connector destroy */
64  FHTTP_ParseHeader parse_header; /* Called when data source is HTTP(S)*/
65  FSERVICE_GetNextInfo get_next_info; /* Called to get connection point(s) */
66  THTTP_Flags flags; /* fHTTP_Flushbl|NoAutoRy|AdjOnRedir */
68 
69 
71 (const char* service,
73  const SConnNetInfo* net_info,
74  const SSERVICE_Extra* extra
75  );
76 
77 #define SERVICE_CreateConnector(service) \
78  SERVICE_CreateConnectorEx(service, fSERV_Any, 0, 0)
79 
80 
81 #ifdef __cplusplus
82 } /* extern "C" */
83 #endif
84 
85 
86 /* @} */
87 
88 #endif /* CONNECT___NCBI_SERVICE_CONNECTOR__H */
static const struct type types[]
Definition: type.c:22
char data[12]
Definition: iconv.c:80
CONNECTOR SERVICE_CreateConnectorEx(const char *service, TSERV_Type types, const SConnNetInfo *net_info, const SSERVICE_Extra *extra)
void(* FSERVICE_Reset)(void *data)
unsigned int THTTP_Flags
Bitwise OR of EHTTP_Flag.
int(* FHTTP_Adjust)(SConnNetInfo *net_info, void *user_data, unsigned int failure_count)
FHTTP_ParseHeader parse_header
const SSERV_Info *(* FSERVICE_GetNextInfo)(void *data, SERV_ITER iter)
FSERVICE_GetNextInfo get_next_info
FSERVICE_Cleanup cleanup
EHTTP_HeaderParse(* FHTTP_ParseHeader)(const char *http_header, void *user_data, int server_error)
void(* FSERVICE_Cleanup)(void *data)
FSERVICE_Reset reset
unsigned int TSERV_Type
Bitwise OR of ESERV_Type[Special].
Definition: ncbi_service.h:94
#define NCBI_XCONNECT_EXPORT
Connector specification.
Modified on Wed Sep 04 14:58:30 2024 by modify_doxy.py rev. 669887