1 | #ifndef SECURITY_DATA_FILE_RECORD_H |
2 | #define SECURITY_DATA_FILE_RECORD_H |
3 | |
4 | /* |
5 | * Legal Notice |
6 | * |
7 | * This document and associated source code (the "Work") is a part of a |
8 | * benchmark specification maintained by the TPC. |
9 | * |
10 | * The TPC reserves all right, title, and interest to the Work as provided |
11 | * under U.S. and international laws, including without limitation all patent |
12 | * and trademark rights therein. |
13 | * |
14 | * No Warranty |
15 | * |
16 | * 1.1 TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE INFORMATION |
17 | * CONTAINED HEREIN IS PROVIDED "AS IS" AND WITH ALL FAULTS, AND THE |
18 | * AUTHORS AND DEVELOPERS OF THE WORK HEREBY DISCLAIM ALL OTHER |
19 | * WARRANTIES AND CONDITIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, |
20 | * INCLUDING, BUT NOT LIMITED TO, ANY (IF ANY) IMPLIED WARRANTIES, |
21 | * DUTIES OR CONDITIONS OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR |
22 | * PURPOSE, OF ACCURACY OR COMPLETENESS OF RESPONSES, OF RESULTS, OF |
23 | * WORKMANLIKE EFFORT, OF LACK OF VIRUSES, AND OF LACK OF NEGLIGENCE. |
24 | * ALSO, THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, |
25 | * QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT |
26 | * WITH REGARD TO THE WORK. |
27 | * 1.2 IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THE WORK BE LIABLE TO |
28 | * ANY OTHER PARTY FOR ANY DAMAGES, INCLUDING BUT NOT LIMITED TO THE |
29 | * COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS |
30 | * OF USE, LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT, |
31 | * INDIRECT, OR SPECIAL DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY, |
32 | * OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR ANY OTHER AGREEMENT |
33 | * RELATING TO THE WORK, WHETHER OR NOT SUCH AUTHOR OR DEVELOPER HAD |
34 | * ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. |
35 | * |
36 | * Contributors |
37 | * - Doug Johnson |
38 | */ |
39 | |
40 | #include <deque> |
41 | #include <string> |
42 | |
43 | #include "utilities/EGenStandardTypes.h" |
44 | |
45 | namespace TPCE { |
46 | // |
47 | // Description: |
48 | // A class to represent a single record in the Security data file. |
49 | // |
50 | // Exception Safety: |
51 | // The Basic guarantee is provided. |
52 | // |
53 | // Copy Behavior: |
54 | // Copying is allowed. |
55 | // |
56 | |
57 | class SecurityDataFileRecord { |
58 | private: |
59 | TIdent s_id; |
60 | |
61 | static const int maxS_st_idLen = 4; |
62 | char s_st_idCStr[maxS_st_idLen + 1]; |
63 | std::string s_st_id; |
64 | |
65 | static const int maxS_symbLen = 7 + 1 + 7; // base + separator + extended |
66 | char s_symbCStr[maxS_symbLen + 1]; |
67 | std::string s_symb; |
68 | |
69 | static const int maxS_issueLen = 6; |
70 | char s_issueCStr[maxS_issueLen + 1]; |
71 | std::string s_issue; |
72 | |
73 | static const int maxS_ex_idLen = 6; |
74 | char s_ex_idCStr[maxS_ex_idLen + 1]; |
75 | std::string s_ex_id; |
76 | |
77 | TIdent s_co_id; |
78 | |
79 | static const unsigned int fieldCount = 6; |
80 | |
81 | public: |
82 | explicit SecurityDataFileRecord(const std::deque<std::string> &fields); |
83 | |
84 | // |
85 | // Default copies and destructor are ok. |
86 | // |
87 | // ~SecurityDataFileRecord() |
88 | // SecurityDataFileRecord(const SecurityDataFileRecord&); |
89 | // SecurityDataFileRecord& operator=(const SecurityDataFileRecord&); |
90 | // |
91 | |
92 | TIdent S_ID() const; |
93 | |
94 | const std::string &S_ST_ID() const; |
95 | const char *S_ST_ID_CSTR() const; |
96 | |
97 | const std::string &S_SYMB() const; |
98 | const char *S_SYMB_CSTR() const; |
99 | |
100 | const std::string &S_ISSUE() const; |
101 | const char *S_ISSUE_CSTR() const; |
102 | |
103 | const std::string &S_EX_ID() const; |
104 | const char *S_EX_ID_CSTR() const; |
105 | |
106 | TIdent S_CO_ID() const; |
107 | |
108 | std::string ToString(char fieldSeparator = '\t') const; |
109 | }; |
110 | |
111 | } // namespace TPCE |
112 | #endif // SECURITY_DATA_FILE_RECORD_H |
113 | |