BLPAPI C++  3.24.5
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 
28 #ifndef INCLUDED_BLPAPI_REQUESTTEMPLATE
29 #define INCLUDED_BLPAPI_REQUESTTEMPLATE
30 
64 #ifndef INCLUDED_BLPAPI_CALL
65 #include <blpapi_call.h>
66 #endif
67 
68 #ifndef INCLUDED_BLPAPI_DEFS
69 #include <blpapi_defs.h>
70 #endif
71 
72 #ifndef INCLUDED_BLPAPI_TYPES
73 #include <blpapi_types.h>
74 #endif
75 
76 #ifdef __cplusplus
77 extern "C" {
78 #endif
79 
82  const blpapi_RequestTemplate_t *requestTemplate);
83 
86  const blpapi_RequestTemplate_t *requestTemplate);
87 
88 #ifdef __cplusplus
89 }
90 
91 #include <cstdlib>
92 #include <utility>
93 
101 namespace BloombergLP {
102 namespace blpapi {
103 
132 
133  blpapi_RequestTemplate_t *d_impl;
134 
135  public:
136  // CREATORS
137  explicit RequestTemplate(blpapi_RequestTemplate_t *handle = 0);
143  RequestTemplate(const RequestTemplate& original);
156  // MANIUPLATORS
166  // ACCESSORS
167  const blpapi_RequestTemplate_t *impl() const;
176 };
177 
181 // ============================================================================
182 // INLINE AND TEMPLATE FUNCTION IMPLEMENTATIONS
183 // ============================================================================
184 
185 // ---------------------
186 // class RequestTemplate
187 // ---------------------
188 // CREATORS
190  : d_impl(handle)
191 {
192 }
193 
195  : d_impl(original.d_impl)
196 {
197  if (d_impl) {
199  }
200 }
201 
203 {
204  if (d_impl) {
207  } else {
208  std::abort();
209  }
210  }
211 }
212 
213 // MANIPULATORS
215 {
216  using std::swap;
217 
218  RequestTemplate tmp(rhs);
219  swap(tmp.d_impl, d_impl);
220 
221  return *this;
222 }
223 
225 {
226  return d_impl;
227 }
228 
230 
231 } // close namespace blpapi
232 } // close namespace BloombergLP
233 
234 #endif // #ifdef __cplusplus
235 #endif // #ifndef INCLUDED_BLPAPI_REQUESTTEMPLATE
Common definitions used by the library.
void swap(Event::iterator &lhs, Event::iterator &rhs)
Swap the contents of the lhs and rhs iterators.
Definition: blpapi_event.h:723
Definition: blpapi_abstractsession.h:220
#define BLPAPI_CALL(FUNCNAME)
Definition: blpapi_call.h:353
RequestTemplate(blpapi_RequestTemplate_t *handle=0)
Definition: blpapi_requesttemplate.h:189
Definition: blpapi_requesttemplate.h:131
const blpapi_RequestTemplate_t * impl() const
Definition: blpapi_requesttemplate.h:224
RequestTemplate & operator=(const RequestTemplate &rhs)
Definition: blpapi_requesttemplate.h:214
struct blpapi_RequestTemplate blpapi_RequestTemplate_t
Definition: blpapi_types.h:163
int blpapi_RequestTemplate_addRef(const blpapi_RequestTemplate_t *requestTemplate)
#define BLPAPI_CALL_UNCHECKED(FUNCNAME)
Definition: blpapi_call.h:354
#define BLPAPI_EXPORT
Definition: blpapi_defs.h:171
#define BLPAPI_CALL_AVAILABLE(FUNCNAME)
Definition: blpapi_call.h:352
Provide functions for dispatchtbl.
Provide BLPAPI types.
int blpapi_RequestTemplate_release(const blpapi_RequestTemplate_t *requestTemplate)
~RequestTemplate()
Definition: blpapi_requesttemplate.h:202