OpenMAMA
MamdaOrderBookExceptions.h
Go to the documentation of this file.
1 /* $Id$
2  *
3  * OpenMAMA: The open middleware agnostic messaging API
4  * Copyright (C) 2011 NYSE Technologies, Inc.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301 USA
20  */
21 
22 #ifndef MamdaOrderBookExceptionsH
23 #define MamdaOrderBookExceptionsH
24 
25 #include <stdexcept>
26 #include <string>
28 
29 using std::invalid_argument;
30 using std::string;
31 
32 namespace Wombat
33 {
34 
35 class MamdaOrderBookEntry;
36 
44 class MAMDAOPTExpDLL MamdaOrderBookException : public invalid_argument
45 {
46 public:
47  MamdaOrderBookException (const string& msg)
48  : invalid_argument (msg)
49  {}
50  virtual ~MamdaOrderBookException() throw () {}
51 };
52 
53 
61 {
62 public:
64  MamdaOrderBookEntry* dupEntry)
65  : MamdaOrderBookException ("duplicate entry ID")
66  , mOrigEntry (origEntry)
67  , mDupEntry (dupEntry)
68  {}
69  MamdaOrderBookEntry* getOrigEntry() { return mOrigEntry; }
70  MamdaOrderBookEntry* getDupEntry() { return mDupEntry; }
71 
72 private:
73  MamdaOrderBookEntry* mOrigEntry;
74  MamdaOrderBookEntry* mDupEntry;
75 };
76 
77 
84 {
85 public:
86  MamdaOrderBookMissingEntry (const string& missingEntryId)
87  : MamdaOrderBookException ("missing entry ID")
88  , mMissingId (missingEntryId)
89  {}
90  virtual ~MamdaOrderBookMissingEntry() throw () {}
91  const char* getMissingEntryId() { return mMissingId.c_str(); }
92 
93 private:
94  string mMissingId;
95 };
96 
97 
105 {
106 public:
108  const string& msg)
110  , mEntry (entry)
111  {}
112  const MamdaOrderBookEntry* getInvalidEntry() { return mEntry; }
113 
114 private:
115  const MamdaOrderBookEntry* mEntry;
116 };
117 
118 
119 } // namespace
120 
121 #endif // MamdaOrderBookExceptionsH
const char * getMissingEntryId()
Definition: MamdaOrderBookExceptions.h:91
MamdaOrderBookDuplicateEntry(MamdaOrderBookEntry *origEntry, MamdaOrderBookEntry *dupEntry)
Definition: MamdaOrderBookExceptions.h:63
MamdaOrderBookEntry is a class that represents an entry within a price level of an order book...
Definition: MamdaOrderBookEntry.h:48
MamdaOrderBookDuplicateEntry is generated when an existing entry is unexpectedly encountered when upd...
Definition: MamdaOrderBookExceptions.h:60
MamdaOrderImbalanceUpdate is an interface that provides access to order imbalance related fields...
Definition: MamdaAuctionFields.h:29
MamdaOrderBookMissingEntry is generated when an expected entry is not found when updating a MamdaOrde...
Definition: MamdaOrderBookExceptions.h:83
virtual ~MamdaOrderBookException()
Definition: MamdaOrderBookExceptions.h:50
MamdaOrderBookEntry * getOrigEntry()
Definition: MamdaOrderBookExceptions.h:69
virtual ~MamdaOrderBookMissingEntry()
Definition: MamdaOrderBookExceptions.h:90
MamdaOrderBookException(const string &msg)
Definition: MamdaOrderBookExceptions.h:47
MamdaOrderBookEntry * getDupEntry()
Definition: MamdaOrderBookExceptions.h:70
MamdaOrderBookInvalidEntry is generated when an entry is applied as an update to or deletion from an ...
Definition: MamdaOrderBookExceptions.h:104
MamdaOrderBookInvalidEntry(const MamdaOrderBookEntry *entry, const string &msg)
Definition: MamdaOrderBookExceptions.h:107
MamdaOrderBookMissingEntry(const string &missingEntryId)
Definition: MamdaOrderBookExceptions.h:86
const MamdaOrderBookEntry * getInvalidEntry()
Definition: MamdaOrderBookExceptions.h:112
MamdaOrderBookException is generated when an inconsistent state is detected in an order book...
Definition: MamdaOrderBookExceptions.h:44


© 2012 Linux Foundation