/usr/include/mamda/MamdaOptionContract.h is in libmamda-dev 2.2.2.1-10.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 | /* $Id$
*
* OpenMAMA: The open middleware agnostic messaging API
* Copyright (C) 2011 NYSE Technologies, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef MamdaOptionContractH
#define MamdaOptionContractH
#include <mamda/MamdaOptionalConfig.h>
#include <mamda/MamdaOptionTypes.h>
#include <mama/mamacpp.h>
#include <vector>
namespace Wombat
{
class MamdaTradeHandler;
class MamdaQuoteHandler;
class MamdaFundamentalHandler;
class MamdaTradeRecap;
class MamdaQuoteRecap;
class MamdaFundamentals;
class MamdaMsgListener;
class MamdaTradeListener;
class MamdaQuoteListener;
class MamdaFundamentalListener;
class MamaDateTime;
/**
* A class that represents a single option contract. Instances of
* this object are typically created by the MamdaOptionChainListener.
* Applications may attach a custom object to each instance of
* MamdaOptionContract.
*
* Note: User applications can be notified of creation of
* MamdaOptionContract instances via the
* MamdaOptionChainListener.onOptionContractCreate() method.
*
* Note: It is possible to provide individual MamdaTradeHandler and
* MamdaQuoteHandler handlers for trades and quotes, even though the
* MamdaOptionChainHandler also provides a general callback interface
* for updates to individual contracts.
*/
class MAMDAOPTExpDLL MamdaOptionContract
{
// No default constructor:
MamdaOptionContract();
public:
/**
* Constructor from expiration date, strike price, and put/call
* indicator.
*
* @param symbol The option symbol.
* @param exchange The exchange identifier.
* @param expireDate The options expiration date.
* @param strikePrice The options strike price.
* @param putCall Whether this is a put or call option.
*/
MamdaOptionContract (const char* symbol,
const char* exchange,
const MamaDateTime& expireDate,
double strikePrice,
MamdaOptionPutCall putCall);
/**
* Constructor without expiration date, strike price, and put/call
* indicator.
*
* @param symbol The option symbol.
* @param exchange The exchange identifier.
*/
MamdaOptionContract (const char* symbol,
const char* exchange);
/**
* Destructor.
*/
~MamdaOptionContract ();
/**
* Set the expiration date.
*
* @param expireDate The options expiration date.
*/
void setExpireDate (const MamaDateTime& expireDate);
/**
* Set the strike price.
*
* @param strikePrice The options strike price.
*/
void setStrikePrice (double strikePrice);
/**
* Set the put/call indicator.
*
* @param putCall Whether this is a put or call option.
*/
void setPutCall (MamdaOptionPutCall putCall);
/**
* Set the open interest size.
*
* @param openInterest The open interest for the option.
*/
void setOpenInterest (uint32_t openInterest);
/**
* Set the exercise style.
*
* @param exerciseStyle The exercise style for the option.
*/
void setExerciseStyle (MamdaOptionExerciseStyle exerciseStyle);
/**
* Set the recap required field. Typically only used by the
* <code>MamdaOptionChainListener</code>
*
* @param recapRequired Whether a recap is required by the contract.
*/
void setRecapRequired(bool recapRequired);
/**
* Return the OPRA contract symbol.
*
* @return The OPRA contract symbol.
*/
const char* getSymbol () const;
/**
* Return the exchange.
*
* @return The exchange identifier.
*/
const char* getExchange () const;
/**
* Return the expiration date.
*
* @return The options expiration date.
*/
const MamaDateTime& getExpireDate () const;
/**
* Return the expiration date as a string.
*
* @return The options expiration date as a string.
*/
const char* getExpireDateStr () const;
/**
* Return whether or not expiration date has been set.
*
* @return Whether the contract has an expiration date set.
*/
bool gotExpireDate() const;
/**
* Return the strike price.
*
* @return The option contracts strike price.
*/
double getStrikePrice () const;
/**
* Return whether or not strike price has been set.
*
* @return Whether the strike price has been set for the contract.
*/
bool gotStrikePrice() const;
/**
* Return the put/call indicator.
*
* @return Indicating whether this is a put or call option contract.
*/
MamdaOptionPutCall getPutCall () const;
/**
* Return whether or not put call has been set.
*
* @return Whether the put/call indicator has been set for this contract.
*/
bool gotPutCall() const;
/**
* Return the level of interest at opening.
*
* @return The opening interest for the option contract.
*/
uint32_t getOpenInterest () const;
/**
* Return whether or not open interest has been set.
*
* @return Whether a value for opening interest has been set for the
* option contract.
*/
bool gotOpenInterest() const;
/**
* Return the style indicator - American(A)/European(E)/Capped(C).
*
* @return The exercise style for the option contract.
*/
MamdaOptionExerciseStyle getExerciseStyle () const;
/**
* Return whether or not exercise style has been set.
*
* @return Whether the exercise style for the option contract has been
* set.
*/
bool gotExerciseStyle() const;
/**
* Get the recap required field. Reserved for use by the
* <code>MamdaOptionChainListener</code>.
*
* @return Whether a recap is required for this contract.
*/
bool getRecapRequired() const;
/**
* Add a generic MamdaMsgListener to this option contract.
*
* @param listener A instance of the listener interface.
*/
void addMsgListener (MamdaMsgListener* listener);
/**
* Add a MamdaTradeHandler for handling trade updates to this
* option contract.
*
* @param handler A trade handler.
*/
void addTradeHandler (MamdaTradeHandler* handler);
/**
* Add a MamdaQuoteHandler for handling quote updates to this
* option contract.
*
* @param handler A quote handler.
*/
void addQuoteHandler (MamdaQuoteHandler* handler);
/**
* Add a MamdaFundamentalHandler for handling fundamental data fields.
*
* @param handler A fundamental handler.
*/
void addFundamentalHandler (MamdaFundamentalHandler* handler);
/**
* Add a custom object to this option contract. Such an object
* might contain customer per-contract data.
*
* @param object Associate closure data with the option contract.
*/
void setCustomObject (void* object);
/**
* Return the current trade fields.
*
* @return The current trade related fields for the option contract.
*/
MamdaTradeRecap& getTradeInfo () const;
/**
* Return the current quote fields.
*
* @return The current quote related fields for the option contract.
*/
MamdaQuoteRecap& getQuoteInfo () const;
/**
* Return the current fundamentals fields.
*
* @return The current fundamental fields for the option contract.
*/
MamdaFundamentals& getFundamentalsInfo () const;
/**
* Return the custom object.
*
* @return The closure.
*/
void* getCustomObject () const;
/**
* Return the vector of message listeners.
*
* @return Vector of message listeners registered with the object.
*/
std::vector<MamdaMsgListener*>& getMsgListeners ();
/**
* Return the trade listener.
*
* @return The registered trade listener.
*/
MamdaTradeListener& getTradeListener ();
/**
* Return the quote listener.
*
* @return The registered quote listener.
*/
MamdaQuoteListener& getQuoteListener ();
/**
* Return the fundamental listener.
*
* @return The registered fundamental listener.
*/
MamdaFundamentalListener& getFundamentalListener ();
/**
* Set whether this contract is in the "view" within the option
* chain.
*
* @param inView Set whether this contract is in the "view" within the
* option chain.
*
* @see MamdaOptionChain
*/
void setInView (bool inView);
/**
* Return whether this contract is in the "view" within the option
* chain.
*
* @return Whether this contract is in the "view" within the option
* chain.
*
* @see MamdaOptionChain
*/
bool getInView ();
/*
* MLS Temporary hack until this is moved to mama
*/
int64_t getSeqNum ();
void setSeqNum (int64_t num);
private:
struct MamdaOptionContractImpl;
MamdaOptionContractImpl& mImpl;
};
} // namespace
#endif // MamdaOptionContractH
|