BLPAPI C++ 3.26.6
Loading...
Searching...
No Matches
blpapi_requesttemplate.h
Go to the documentation of this file.
1/* Copyright 2015. 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_REQUESTTEMPLATE
39#define INCLUDED_BLPAPI_REQUESTTEMPLATE
40
72
73#ifndef INCLUDED_BLPAPI_CALL
74#include <blpapi_call.h>
75#endif
76
77#ifndef INCLUDED_BLPAPI_DEFS
78#include <blpapi_defs.h>
79#endif
80
81#ifndef INCLUDED_BLPAPI_TYPES
82#include <blpapi_types.h>
83#endif
84
85#ifdef __cplusplus
86extern "C" {
87#endif
88
92
94
108BLPAPI_EXPORT
109int blpapi_RequestTemplate_addRef(
110 const blpapi_RequestTemplate_t *requestTemplate);
111
128BLPAPI_EXPORT
129int blpapi_RequestTemplate_release(
130 const blpapi_RequestTemplate_t *requestTemplate);
132
134
135#ifdef __cplusplus
136}
137
138#include <cstdlib>
139#include <utility>
140
141namespace BloombergLP {
142namespace blpapi {
149
178
179 blpapi_RequestTemplate_t *d_impl;
180
181 public:
182 // CREATORS
183 explicit RequestTemplate(blpapi_RequestTemplate_t *handle = 0);
188
189 RequestTemplate(const RequestTemplate& original);
195
201
202 // MANIUPLATORS
211
212 // ACCESSORS
214 const blpapi_RequestTemplate_t *impl() const;
218
219 blpapi_RequestTemplate_t *impl();
224};
225
228
229// ============================================================================
230// INLINE AND TEMPLATE FUNCTION IMPLEMENTATIONS
231// ============================================================================
232
233// ---------------------
234// class RequestTemplate
235// ---------------------
236// CREATORS
237inline RequestTemplate::RequestTemplate(blpapi_RequestTemplate_t *handle)
238 : d_impl(handle)
239{
240}
241
243 : d_impl(original.d_impl)
244{
245 if (d_impl) {
246 BLPAPI_CALL(blpapi_RequestTemplate_addRef)(d_impl);
247 }
248}
249
251{
252 if (d_impl) {
253 if (BLPAPI_CALL_AVAILABLE(blpapi_RequestTemplate_release)) {
254 BLPAPI_CALL_UNCHECKED(blpapi_RequestTemplate_release)(d_impl);
255 } else {
256 std::abort();
257 }
258 }
259}
260
261// MANIPULATORS
263{
264 using std::swap;
265
266 RequestTemplate tmp(rhs);
267 swap(tmp.d_impl, d_impl);
268
269 return *this;
270}
271
273inline const blpapi_RequestTemplate_t *RequestTemplate::impl() const
274{
275 return d_impl;
276}
277
278inline blpapi_RequestTemplate_t *RequestTemplate::impl() { return d_impl; }
280
281} // close namespace blpapi
282} // close namespace BloombergLP
283
284#endif // #ifdef __cplusplus
285#endif // #ifndef INCLUDED_BLPAPI_REQUESTTEMPLATE
Provide functions for dispatchtbl.
Common definitions used by the library.
Provide BLPAPI types.
RequestTemplate & operator=(const RequestTemplate &rhs)
Definition blpapi_requesttemplate.h:262
~RequestTemplate()
Definition blpapi_requesttemplate.h:250
RequestTemplate(blpapi_RequestTemplate_t *handle=0)
Definition blpapi_requesttemplate.h:237
void swap(Event::iterator &lhs, Event::iterator &rhs)
Swap the contents of the lhs and rhs iterators.
Definition blpapi_event.h:860
Definition blpapi_abstractsession.h:452
Definition blpapi_abstractsession.h:451