1#ifndef DATA_FILE_TYPES_H
2#define DATA_FILE_TYPES_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 <string>
41
42// General data file types.
43#include "DataFile.h"
44#include "WeightedDataFile.h"
45#include "BucketedDataFile.h"
46
47// Specific data file types.
48#include "AreaCodeDataFileRecord.h"
49#include "ChargeDataFileRecord.h"
50#include "CommissionRateDataFileRecord.h"
51#include "CompanyCompetitorDataFileRecord.h"
52#include "CompanyDataFileRecord.h"
53#include "CompanySPRateDataFileRecord.h"
54#include "ExchangeDataFileRecord.h"
55#include "FemaleFirstNameDataFileRecord.h"
56#include "IndustryDataFileRecord.h"
57#include "LastNameDataFileRecord.h"
58#include "MaleFirstNameDataFileRecord.h"
59#include "NewsDataFileRecord.h"
60#include "NonTaxableAccountNameDataFileRecord.h"
61#include "SectorDataFileRecord.h"
62#include "SecurityDataFileRecord.h"
63#include "StatusTypeDataFileRecord.h"
64#include "StreetNameDataFileRecord.h"
65#include "StreetSuffixDataFileRecord.h"
66#include "TaxableAccountNameDataFileRecord.h"
67#include "TaxRateCountryDataFileRecord.h"
68#include "TaxRateDivisionDataFileRecord.h"
69#include "TradeTypeDataFileRecord.h"
70#include "ZipCodeDataFileRecord.h"
71
72namespace TPCE {
73
74// For convenience provide a type for each specific data file type.
75typedef WeightedDataFile<AreaCodeDataFileRecord> AreaCodeDataFile_t;
76typedef DataFile<ChargeDataFileRecord> ChargeDataFile_t;
77typedef DataFile<CommissionRateDataFileRecord> CommissionRateDataFile_t;
78typedef DataFile<CompanyCompetitorDataFileRecord> CompanyCompetitorDataFile_t;
79typedef DataFile<CompanyDataFileRecord> CompanyDataFile_t;
80typedef WeightedDataFile<CompanySPRateDataFileRecord> CompanySPRateDataFile_t;
81typedef DataFile<ExchangeDataFileRecord> ExchangeDataFile_t;
82typedef WeightedDataFile<FemaleFirstNameDataFileRecord> FemaleFirstNameDataFile_t;
83typedef DataFile<IndustryDataFileRecord> IndustryDataFile_t;
84typedef WeightedDataFile<LastNameDataFileRecord> LastNameDataFile_t;
85typedef WeightedDataFile<MaleFirstNameDataFileRecord> MaleFirstNameDataFile_t;
86typedef WeightedDataFile<NewsDataFileRecord> NewsDataFile_t;
87typedef DataFile<NonTaxableAccountNameDataFileRecord> NonTaxableAccountNameDataFile_t;
88typedef DataFile<SectorDataFileRecord> SectorDataFile_t;
89typedef DataFile<SecurityDataFileRecord> SecurityDataFile_t;
90typedef DataFile<StatusTypeDataFileRecord> StatusTypeDataFile_t;
91typedef WeightedDataFile<StreetNameDataFileRecord> StreetNameDataFile_t;
92typedef WeightedDataFile<StreetSuffixDataFileRecord> StreetSuffixDataFile_t;
93typedef DataFile<TaxableAccountNameDataFileRecord> TaxableAccountNameDataFile_t;
94typedef BucketedDataFile<TaxRateCountryDataFileRecord> TaxRateCountryDataFile_t;
95typedef BucketedDataFile<TaxRateDivisionDataFileRecord> TaxRateDivisionDataFile_t;
96typedef DataFile<TradeTypeDataFileRecord> TradeTypeDataFile_t;
97typedef WeightedDataFile<ZipCodeDataFileRecord> ZipCodeDataFile_t;
98
99// WARNING: the DataFileManager constructor is tightly coupled to the order of
100// this enum. List of file types.
101enum DataFileType {
102 AREA_CODE_DATA_FILE,
103 CHARGE_DATA_FILE,
104 COMMISSION_RATE_DATA_FILE,
105 COMPANY_COMPETITOR_DATA_FILE,
106 COMPANY_DATA_FILE,
107 COMPANY_SP_RATE_DATA_FILE,
108 EXCHANGE_DATA_FILE,
109 FEMALE_FIRST_NAME_DATA_FILE,
110 INDUSTRY_DATA_FILE,
111 LAST_NAME_DATA_FILE,
112 MALE_FIRST_NAME_DATA_FILE,
113 NEWS_DATA_FILE,
114 NON_TAXABLE_ACCOUNT_NAME_DATA_FILE,
115 SECTOR_DATA_FILE,
116 SECURITY_DATA_FILE,
117 STATUS_TYPE_DATA_FILE,
118 STREET_NAME_DATA_FILE,
119 STREET_SUFFIX_DATA_FILE,
120 TAXABLE_ACCOUNT_NAME_DATA_FILE,
121 TAX_RATE_COUNTRY_DATA_FILE,
122 TAX_RATE_DIVISION_DATA_FILE,
123 TRADE_TYPE_DATA_FILE,
124 ZIPCODE_DATA_FILE
125};
126
127// Default data file names.
128static const char *const DataFileNames[] = {"AreaCode",
129 "Charge",
130 "CommissionRate",
131 "CompanyCompetitor",
132 "Company",
133 "CompanySPRate",
134 "Exchange",
135 "FemaleFirstName",
136 "Industry",
137 "LastName",
138 "MaleFirstName",
139 "LastName", // News uses last names as a source of words.
140 "NonTaxableAccountName",
141 "Sector",
142 "Security",
143 "StatusType",
144 "StreetName",
145 "StreetSuffix",
146 "TaxableAccountName",
147 "TaxRatesCountry",
148 "TaxRatesDivision",
149 "TradeType",
150 "ZipCode"};
151
152// Default data file extension.
153static const std::string DataFileExtension(".txt");
154
155} // namespace TPCE
156#endif // DATA_FILE_TYPES_H
157