BLPAPI C++ 3.26.5
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
35
36#ifndef INCLUDED_BLPAPI_REQUESTTEMPLATE
37#define INCLUDED_BLPAPI_REQUESTTEMPLATE
38
71
72#ifndef INCLUDED_BLPAPI_CALL
73#include <blpapi_call.h>
74#endif
75
76#ifndef INCLUDED_BLPAPI_DEFS
77#include <blpapi_defs.h>
78#endif
79
80#ifndef INCLUDED_BLPAPI_TYPES
81#include <blpapi_types.h>
82#endif
83
84#ifdef __cplusplus
85extern "C" {
86#endif
87
89
92
93BLPAPI_EXPORT
94int blpapi_RequestTemplate_addRef(
95 const blpapi_RequestTemplate_t *requestTemplate);
96
97BLPAPI_EXPORT
98int blpapi_RequestTemplate_release(
99 const blpapi_RequestTemplate_t *requestTemplate);
100
103
104#ifdef __cplusplus
105}
106
107#include <cstdlib>
108#include <utility>
109
116
117namespace BloombergLP {
118namespace blpapi {
119
148
149 blpapi_RequestTemplate_t *d_impl;
150
151 public:
152 // CREATORS
153 explicit RequestTemplate(blpapi_RequestTemplate_t *handle = 0);
158
159 RequestTemplate(const RequestTemplate& original);
165
171
172 // MANIUPLATORS
181
182 // ACCESSORS
183 const blpapi_RequestTemplate_t *impl() const;
187
188 blpapi_RequestTemplate_t *impl();
192};
193
196
197// ============================================================================
198// INLINE AND TEMPLATE FUNCTION IMPLEMENTATIONS
199// ============================================================================
200
201// ---------------------
202// class RequestTemplate
203// ---------------------
204// CREATORS
205inline RequestTemplate::RequestTemplate(blpapi_RequestTemplate_t *handle)
206 : d_impl(handle)
207{
208}
209
211 : d_impl(original.d_impl)
212{
213 if (d_impl) {
214 BLPAPI_CALL(blpapi_RequestTemplate_addRef)(d_impl);
215 }
216}
217
219{
220 if (d_impl) {
221 if (BLPAPI_CALL_AVAILABLE(blpapi_RequestTemplate_release)) {
222 BLPAPI_CALL_UNCHECKED(blpapi_RequestTemplate_release)(d_impl);
223 } else {
224 std::abort();
225 }
226 }
227}
228
229// MANIPULATORS
231{
232 using std::swap;
233
234 RequestTemplate tmp(rhs);
235 swap(tmp.d_impl, d_impl);
236
237 return *this;
238}
239
240inline const blpapi_RequestTemplate_t *RequestTemplate::impl() const
241{
242 return d_impl;
243}
244
245inline blpapi_RequestTemplate_t *RequestTemplate::impl() { return d_impl; }
246
247} // close namespace blpapi
248} // close namespace BloombergLP
249
250#endif // #ifdef __cplusplus
251#endif // #ifndef INCLUDED_BLPAPI_REQUESTTEMPLATE
Provide functions for dispatchtbl.
#define BLPAPI_CALL_UNCHECKED(FUNCNAME)
Definition blpapi_call.h:362
#define BLPAPI_CALL_AVAILABLE(FUNCNAME)
Definition blpapi_call.h:360
#define BLPAPI_CALL(FUNCNAME)
Definition blpapi_call.h:361
Common definitions used by the library.
Provide BLPAPI types.
RequestTemplate & operator=(const RequestTemplate &rhs)
Definition blpapi_requesttemplate.h:230
const blpapi_RequestTemplate_t * impl() const
Definition blpapi_requesttemplate.h:240
~RequestTemplate()
Definition blpapi_requesttemplate.h:218
RequestTemplate(blpapi_RequestTemplate_t *handle=0)
Definition blpapi_requesttemplate.h:205
void swap(Event::iterator &lhs, Event::iterator &rhs)
Swap the contents of the lhs and rhs iterators.
Definition blpapi_event.h:739
Definition blpapi_abstractsession.h:212
Definition blpapi_abstractsession.h:211