BLPAPI C++ 3.26.6
Loading...
Searching...
No Matches
blpapi_streamproxy.h
Go to the documentation of this file.
1/* Copyright 2012. Bloomberg Finance L.P.
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to
5 * deal in the Software without restriction, including without limitation the
6 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 * sell copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions: The above
9 * copyright notice and this permission notice shall be included in all copies
10 * or substantial portions of the Software.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
18 * IN THE SOFTWARE.
19 */
20
37
38#ifndef INCLUDED_BLPAPI_STREAMPROXY
39#define INCLUDED_BLPAPI_STREAMPROXY
40
60
62
65
66typedef int (*blpapi_StreamWriter_t)(
67 const char *data, int length, void *stream);
68
71
72#ifdef __cplusplus
73
74#include <cassert>
75#include <ostream>
76
77namespace BloombergLP {
78namespace blpapi {
85
86inline int OstreamWriter(const char *data, int length, void *stream);
90
92
93 static int writeToStream(const char *data, int length, void *stream);
99};
100
103
104//=============================================================================
105// INLINE FUNCTION DEFINITIONS
106//=============================================================================
107
109 const char *data, int length, void *stream)
110{
111 assert(stream);
112
113 reinterpret_cast<std::ostream *>(stream)->write(data, length);
114 return 0;
115}
116
117inline int OstreamWriter(const char *data, int length, void *stream)
118{
119 return StreamProxyOstream::writeToStream(data, length, stream);
120}
121
122} // close namespace blpapi
123} // close namespace BloombergLP
124
125#endif // #ifdef __cplusplus
126#endif // #ifndef INCLUDED_BLPAPI_STREAMPROXY
int OstreamWriter(const char *data, int length, void *stream)
Definition blpapi_streamproxy.h:117
Definition blpapi_abstractsession.h:452
Definition blpapi_abstractsession.h:451
Definition blpapi_streamproxy.h:91
static int writeToStream(const char *data, int length, void *stream)
Definition blpapi_streamproxy.h:108