|
From: <qua...@us...> - 2010-10-14 16:40:24
|
Revision: 348
http://stdair.svn.sourceforge.net/stdair/?rev=348&view=rev
Author: quannaus
Date: 2010-10-14 16:40:17 +0000 (Thu, 14 Oct 2010)
Log Message:
-----------
[dev] Removed '_T' from 'Struct_T' - not a typedef.
Modified Paths:
--------------
trunk/stdair/stdair/STDAIR_Types.hpp
trunk/stdair/stdair/basic/BasConst.cpp
trunk/stdair/stdair/basic/BasConst_General.hpp
trunk/stdair/stdair/bom/AirlineFeature.cpp
trunk/stdair/stdair/bom/AirlineFeature.hpp
trunk/stdair/stdair/bom/DoWStruct.cpp
trunk/stdair/stdair/bom/DoWStruct.hpp
trunk/stdair/stdair/bom/FlightPeriod.hpp
trunk/stdair/stdair/bom/FlightPeriodKey.cpp
trunk/stdair/stdair/bom/FlightPeriodKey.hpp
trunk/stdair/stdair/bom/OptimizerStruct.cpp
trunk/stdair/stdair/bom/OptimizerStruct.hpp
trunk/stdair/stdair/bom/PeriodStruct.cpp
trunk/stdair/stdair/bom/PeriodStruct.hpp
Modified: trunk/stdair/stdair/STDAIR_Types.hpp
===================================================================
--- trunk/stdair/stdair/STDAIR_Types.hpp 2010-10-14 13:37:06 UTC (rev 347)
+++ trunk/stdair/stdair/STDAIR_Types.hpp 2010-10-14 16:40:17 UTC (rev 348)
@@ -94,6 +94,9 @@
/** Define the Airline Code type (2-letter-code, e.g., BA). */
typedef std::string AirlineCode_T;
+ /** Define a list of airline code. */
+ typedef std::vector<AirlineCode_T> AirlineCodeList_T;
+
/** Location code (3-letter-code, e.g., LON). */
typedef std::string LocationCode_T;
@@ -236,6 +239,9 @@
B, K, etc.). */
typedef std::string ClassCode_T;
+ /** Define a list of class code. */
+ typedef std::vector<ClassCode_T> ClassCodeList_T;
+
/** Define the sub-class code (e.g., 0, 1, 2, etc.). The subclass is
a sub-structure for the booking class, allowing to have specific
rules for some criteria like POS. */
Modified: trunk/stdair/stdair/basic/BasConst.cpp
===================================================================
--- trunk/stdair/stdair/basic/BasConst.cpp 2010-10-14 13:37:06 UTC (rev 347)
+++ trunk/stdair/stdair/basic/BasConst.cpp 2010-10-14 16:40:17 UTC (rev 348)
@@ -29,8 +29,7 @@
const Duration_T NULL_BOOST_TIME_DURATION =
boost::posix_time::hours(0)+ boost::posix_time::minutes (0)
+ boost::posix_time::seconds (0);
-
-
+
// //////// (Flight-)Period-related BOM ///////
/** Default number of duration days. */
const DayDuration_T DEFAULT_DAY_DURATION (0);
Modified: trunk/stdair/stdair/basic/BasConst_General.hpp
===================================================================
--- trunk/stdair/stdair/basic/BasConst_General.hpp 2010-10-14 13:37:06 UTC (rev 347)
+++ trunk/stdair/stdair/basic/BasConst_General.hpp 2010-10-14 16:40:17 UTC (rev 348)
@@ -53,5 +53,27 @@
/** Default random seed. */
extern const RandomSeed_T DEFAULT_RANDOM_SEED;
+
+ /** Null time duration (in boost::time_duration unit).*/
+ extern const Duration_T NULL_BOOST_TIME_DURATION;
+
+ /** Default value of Availability. */
+ extern const Fare_T DEFAULT_CLASS_FARE_VALUE;
+
+ /** Default number of airlines. */
+ extern const NbOfAirlines_T DEFAULT_NBOFAIRLINES;
+
+ /** Default airlineCode value ('XX'). */
+ extern const AirlineCode_T DEFAULT_AIRLINE_CODE;
+
+ /** Default airlineCode value (''). */
+ extern const AirlineCode_T DEFAULT_NULL_AIRLINE_CODE;
+
+ /** Default classCode value ('X'). */
+ extern const ClassCode_T DEFAULT_CLASS_CODE;
+
+ /** Default null classCode value (''). */
+ extern const ClassCode_T DEFAULT_NULL_CLASS_CODE;
+
}
#endif // __STDAIR_BAS_BASCONST_GENERAL_HPP
Modified: trunk/stdair/stdair/bom/AirlineFeature.cpp
===================================================================
--- trunk/stdair/stdair/bom/AirlineFeature.cpp 2010-10-14 13:37:06 UTC (rev 347)
+++ trunk/stdair/stdair/bom/AirlineFeature.cpp 2010-10-14 16:40:17 UTC (rev 348)
@@ -21,7 +21,7 @@
// ////////////////////////////////////////////////////////////////////
void AirlineFeature::init (const ForecasterMode_T& iForecastMode,
const HistoricalDataLimit_T& iHistoricalDataLimit,
- const OptimizerStruct_T& iOptimizerStruct,
+ const OptimizerStruct& iOptimizerStruct,
const ControlMode_T& iControlMode) {
_forecasterMode = iForecastMode;
_historicalDataLimit = iHistoricalDataLimit;
Modified: trunk/stdair/stdair/bom/AirlineFeature.hpp
===================================================================
--- trunk/stdair/stdair/bom/AirlineFeature.hpp 2010-10-14 13:37:06 UTC (rev 347)
+++ trunk/stdair/stdair/bom/AirlineFeature.hpp 2010-10-14 16:40:17 UTC (rev 348)
@@ -32,7 +32,7 @@
// //////////// Setters //////////
/** Intialization method. */
void init (const ForecasterMode_T&, const HistoricalDataLimit_T&,
- const OptimizerStruct_T&, const ControlMode_T&);
+ const OptimizerStruct&, const ControlMode_T&);
public:
// /////////// Display support methods /////////
@@ -70,7 +70,7 @@
HistoricalDataLimit_T _historicalDataLimit;
/** The type of optimizer. */
- OptimizerStruct_T _optimizerStruct;
+ OptimizerStruct _optimizerStruct;
/** The type of inventory control. */
ControlMode_T _controlMode;
Modified: trunk/stdair/stdair/bom/DoWStruct.cpp
===================================================================
--- trunk/stdair/stdair/bom/DoWStruct.cpp 2010-10-14 13:37:06 UTC (rev 347)
+++ trunk/stdair/stdair/bom/DoWStruct.cpp 2010-10-14 16:40:17 UTC (rev 348)
@@ -11,14 +11,14 @@
namespace stdair {
// ////////////////////////////////////////////////////////////////////
- DoWStruct_T::DoWStruct_T () {
+ DoWStruct::DoWStruct () {
for (unsigned short i = 0; i < 7; ++i) {
_dowList.push_back (false);
}
}
// ////////////////////////////////////////////////////////////////////
- DoWStruct_T::DoWStruct_T (const std::string& iDowString) {
+ DoWStruct::DoWStruct (const std::string& iDowString) {
const unsigned short lDowStringSize = iDowString.size();
assert (lDowStringSize == 7);
@@ -31,13 +31,13 @@
}
// ////////////////////////////////////////////////////////////////////
- DoWStruct_T::DoWStruct_T (const DoWStruct_T& iDowStruct) :
+ DoWStruct::DoWStruct (const DoWStruct& iDowStruct) :
_dowList (iDowStruct._dowList) {
}
// ////////////////////////////////////////////////////////////////////
- const std::string DoWStruct_T::describeShort() const {
+ const std::string DoWStruct::describeShort() const {
std::ostringstream ostr;
short i = 0;
for (BooleanList_T::const_iterator itDoW = _dowList.begin();
@@ -49,7 +49,7 @@
}
// ////////////////////////////////////////////////////////////////////
- const std::string DoWStruct_T::describe() const {
+ const std::string DoWStruct::describe() const {
std::ostringstream ostr;
short i = 0;
for (BooleanList_T::const_iterator itDoW = _dowList.begin();
@@ -63,12 +63,12 @@
}
// ////////////////////////////////////////////////////////////////////
- bool DoWStruct_T::getDayOfWeek (const unsigned short i) const {
+ bool DoWStruct::getDayOfWeek (const unsigned short i) const {
return _dowList.at (i);
}
// ////////////////////////////////////////////////////////////////////
- bool DoWStruct_T::getStandardDayOfWeek (const unsigned short i) const {
+ bool DoWStruct::getStandardDayOfWeek (const unsigned short i) const {
unsigned short iStd = i;
if (iStd == 0) {
iStd = 6;
@@ -79,14 +79,14 @@
}
// ////////////////////////////////////////////////////////////////////
- void DoWStruct_T::setDayOfWeek (const unsigned short i, const bool iBool) {
+ void DoWStruct::setDayOfWeek (const unsigned short i, const bool iBool) {
assert (i < 7);
_dowList.at (i) = iBool;
}
// ////////////////////////////////////////////////////////////////////
- DoWStruct_T DoWStruct_T::shift (const long& iNbOfDays) const {
- DoWStruct_T oDoW (DEFAULT_DOW_STRING);
+ DoWStruct DoWStruct::shift (const long& iNbOfDays) const {
+ DoWStruct oDoW (DEFAULT_DOW_STRING);
for (short i = 0; i < 7; ++i) {
const bool lDoWBool = _dowList.at (i);
@@ -101,8 +101,8 @@
}
// ////////////////////////////////////////////////////////////////////
- DoWStruct_T DoWStruct_T::intersection (const DoWStruct_T& iDoW) const {
- DoWStruct_T oDoW (DEFAULT_DOW_STRING);
+ DoWStruct DoWStruct::intersection (const DoWStruct& iDoW) const {
+ DoWStruct oDoW (DEFAULT_DOW_STRING);
for (unsigned short i = 0; i < 7; ++i) {
if (getDayOfWeek(i) && iDoW.getDayOfWeek(i)) {
oDoW.setDayOfWeek (i, true);
@@ -114,7 +114,7 @@
}
// ////////////////////////////////////////////////////////////////////
- const bool DoWStruct_T::isValid () const {
+ const bool DoWStruct::isValid () const {
for (unsigned short i = 0; i < 7; ++i) {
if (getDayOfWeek(i)) {
return true;
Modified: trunk/stdair/stdair/bom/DoWStruct.hpp
===================================================================
--- trunk/stdair/stdair/bom/DoWStruct.hpp 2010-10-14 13:37:06 UTC (rev 347)
+++ trunk/stdair/stdair/bom/DoWStruct.hpp 2010-10-14 16:40:17 UTC (rev 348)
@@ -15,7 +15,7 @@
/** Define a Day Of the Week (DoW) sequence.
<br>For instance, 1..11.1 means that the period is active on
Mon., Thu., Fri. and Sun. */
- struct DoWStruct_T : public StructAbstract {
+ struct DoWStruct : public StructAbstract {
public:
/** Define the bit set representing the DoW. */
typedef std::vector<bool> BooleanList_T;
@@ -44,10 +44,10 @@
public:
// ///////////////// Business Methods ////////////////
/** Build a new DoW struct by shifting the current DoW by a given number. */
- DoWStruct_T shift (const long&) const;
+ DoWStruct shift (const long&) const;
/** Build a new DoW struct by intersecting two DoW structs. */
- DoWStruct_T intersection (const DoWStruct_T&) const;
+ DoWStruct intersection (const DoWStruct&) const;
/** Return if the DoW struct is valid (i.e., has at least one "true"). */
const bool isValid () const;
@@ -55,12 +55,12 @@
public:
/** Constructor from a given bit set (e.g., "0000011" for the
week-ends). */
- DoWStruct_T (const std::string& iDowString);
+ DoWStruct (const std::string& iDowString);
/** Default constructors. */
- DoWStruct_T ();
- DoWStruct_T (const DoWStruct_T&);
+ DoWStruct ();
+ DoWStruct (const DoWStruct&);
/** Default destructor. */
- ~DoWStruct_T () { }
+ ~DoWStruct () { }
private:
/** Attributes. */
Modified: trunk/stdair/stdair/bom/FlightPeriod.hpp
===================================================================
--- trunk/stdair/stdair/bom/FlightPeriod.hpp 2010-10-14 13:37:06 UTC (rev 347)
+++ trunk/stdair/stdair/bom/FlightPeriod.hpp 2010-10-14 16:40:17 UTC (rev 348)
@@ -35,7 +35,7 @@
}
/** Get the departure period (part of the key). */
- const PeriodStruct_T& getPeriod () const { return _key.getPeriod(); }
+ const PeriodStruct& getPeriod () const { return _key.getPeriod(); }
/** Get the map of children holders. */
const HolderMap_T& getHolderMap() const { return _holderMap; }
Modified: trunk/stdair/stdair/bom/FlightPeriodKey.cpp
===================================================================
--- trunk/stdair/stdair/bom/FlightPeriodKey.cpp 2010-10-14 13:37:06 UTC (rev 347)
+++ trunk/stdair/stdair/bom/FlightPeriodKey.cpp 2010-10-14 16:40:17 UTC (rev 348)
@@ -8,7 +8,7 @@
// ////////////////////////////////////////////////////////////////////
FlightPeriodKey::FlightPeriodKey (const FlightNumber_T& iFlightNumber,
- const PeriodStruct_T& iPeriod)
+ const PeriodStruct& iPeriod)
: _flightNumber (iFlightNumber), _period (iPeriod) {
}
Modified: trunk/stdair/stdair/bom/FlightPeriodKey.hpp
===================================================================
--- trunk/stdair/stdair/bom/FlightPeriodKey.hpp 2010-10-14 13:37:06 UTC (rev 347)
+++ trunk/stdair/stdair/bom/FlightPeriodKey.hpp 2010-10-14 16:40:17 UTC (rev 348)
@@ -18,7 +18,7 @@
public:
// /////////// Construction ///////////
/** Constructors. */
- FlightPeriodKey (const FlightNumber_T&, const PeriodStruct_T&);
+ FlightPeriodKey (const FlightNumber_T&, const PeriodStruct&);
FlightPeriodKey (const FlightPeriodKey&);
/** Destructor. */
~FlightPeriodKey ();
@@ -30,7 +30,7 @@
}
/** Get the active days-of-week. */
- const PeriodStruct_T& getPeriod () const {
+ const PeriodStruct& getPeriod () const {
return _period;
}
@@ -56,7 +56,7 @@
FlightNumber_T _flightNumber;
/** Period during the departure period. */
- PeriodStruct_T _period;
+ PeriodStruct _period;
};
Modified: trunk/stdair/stdair/bom/OptimizerStruct.cpp
===================================================================
--- trunk/stdair/stdair/bom/OptimizerStruct.cpp 2010-10-14 13:37:06 UTC (rev 347)
+++ trunk/stdair/stdair/bom/OptimizerStruct.cpp 2010-10-14 16:40:17 UTC (rev 348)
@@ -11,11 +11,11 @@
namespace stdair {
// ///////////////////////////////////////////////////////////////////
- OptimizerStruct_T::OptimizerStruct_T () {
+ OptimizerStruct::OptimizerStruct () {
}
// ///////////////////////////////////////////////////////////////////
- OptimizerStruct_T::OptimizerStruct_T
+ OptimizerStruct::OptimizerStruct
(const OptimizerMode_T& iOptimizerMode,
const SellupFlagForOptimizer_T& iSellupFlagForOptimizer,
const SellupProbabilityVector_T& iSellupProbabilityVectorForOptimizer)
@@ -25,19 +25,19 @@
}
// ///////////////////////////////////////////////////////////////////
- OptimizerStruct_T::OptimizerStruct_T
- (const OptimizerStruct_T& iOptimizerStruct)
+ OptimizerStruct::OptimizerStruct
+ (const OptimizerStruct& iOptimizerStruct)
: _optimizerMode(iOptimizerStruct._optimizerMode),
_sellupFlagForOptimizer(iOptimizerStruct._sellupFlagForOptimizer),
_sellupProbabilityVectorForOptimizer(iOptimizerStruct._sellupProbabilityVectorForOptimizer) {
}
// ////////////////////////////////////////////////////////////////////
- OptimizerStruct_T::~OptimizerStruct_T () {
+ OptimizerStruct::~OptimizerStruct () {
}
// ////////////////////////////////////////////////////////////////////
- void OptimizerStruct_T::
+ void OptimizerStruct::
init (const OptimizerMode_T& iOptimizerMode,
const SellupFlagForOptimizer_T& iSellupFlagForOptimizer,
const SellupProbabilityVector_T& iSellupProbabilityVectorForOptimizer) {
@@ -47,7 +47,7 @@
}
// ////////////////////////////////////////////////////////////////////
- const std::string OptimizerStruct_T::describe() const {
+ const std::string OptimizerStruct::describe() const {
std::ostringstream ostr;
ostr << _optimizerMode
<< "," << _sellupFlagForOptimizer
@@ -56,7 +56,7 @@
}
// //////////////////////////////////////////////////////////////////////
- const std::string OptimizerStruct_T::describeSellupProbabilityVector() const {
+ const std::string OptimizerStruct::describeSellupProbabilityVector() const {
std::ostringstream ostr;
for (SellupProbabilityVector_T::const_iterator itValue =
_sellupProbabilityVectorForOptimizer.begin();
Modified: trunk/stdair/stdair/bom/OptimizerStruct.hpp
===================================================================
--- trunk/stdair/stdair/bom/OptimizerStruct.hpp 2010-10-14 13:37:06 UTC (rev 347)
+++ trunk/stdair/stdair/bom/OptimizerStruct.hpp 2010-10-14 16:40:17 UTC (rev 348)
@@ -10,7 +10,7 @@
namespace stdair {
/** Utility structure for parsing optimizer setting. */
- struct OptimizerStruct_T {
+ struct OptimizerStruct {
public:
// /////////// Getters ////////////////
/** Get the optimizer mode. */
@@ -43,16 +43,16 @@
public:
/** Default constructor. */
- OptimizerStruct_T ();
+ OptimizerStruct ();
/** Constructor. */
- OptimizerStruct_T (const OptimizerMode_T&,
+ OptimizerStruct (const OptimizerMode_T&,
const SellupFlagForOptimizer_T&,
const SellupProbabilityVector_T&);
/** Default copy constructor. */
- OptimizerStruct_T (const OptimizerStruct_T&);
+ OptimizerStruct (const OptimizerStruct&);
/** Defaut destructor. */
- ~OptimizerStruct_T ();
+ ~OptimizerStruct ();
private:
// /////////////// Attributes //////////
Modified: trunk/stdair/stdair/bom/PeriodStruct.cpp
===================================================================
--- trunk/stdair/stdair/bom/PeriodStruct.cpp 2010-10-14 13:37:06 UTC (rev 347)
+++ trunk/stdair/stdair/bom/PeriodStruct.cpp 2010-10-14 16:40:17 UTC (rev 348)
@@ -10,38 +10,38 @@
namespace stdair {
// ////////////////////////////////////////////////////////////////////
- PeriodStruct_T::PeriodStruct_T ()
+ PeriodStruct::PeriodStruct ()
: _dateRange (BOOST_DEFAULT_DATE_PERIOD), _dow () {
}
// ////////////////////////////////////////////////////////////////////
- PeriodStruct_T::PeriodStruct_T (const DatePeriod_T& iDateRange,
- const DoWStruct_T& iDoW)
+ PeriodStruct::PeriodStruct (const DatePeriod_T& iDateRange,
+ const DoWStruct& iDoW)
: _dateRange (iDateRange), _dow (iDoW) {
}
// ////////////////////////////////////////////////////////////////////
- PeriodStruct_T::PeriodStruct_T (const PeriodStruct_T& iPeriodStruct)
+ PeriodStruct::PeriodStruct (const PeriodStruct& iPeriodStruct)
: _dateRange (iPeriodStruct._dateRange), _dow (iPeriodStruct._dow) {
}
// ////////////////////////////////////////////////////////////////////
- const std::string PeriodStruct_T::describeShort() const {
+ const std::string PeriodStruct::describeShort() const {
std::ostringstream ostr;
ostr << _dateRange << ", " << _dow.describeShort ();
return ostr.str();
}
// ////////////////////////////////////////////////////////////////////
- const std::string PeriodStruct_T::describe() const {
+ const std::string PeriodStruct::describe() const {
std::ostringstream ostr;
ostr << _dateRange << ", " << _dow.describe ();
return ostr.str();
}
// ////////////////////////////////////////////////////////////////////
- PeriodStruct_T PeriodStruct_T::
+ PeriodStruct PeriodStruct::
addDateOffset (const DateOffset_T& iDateOffset) const {
// Create a new date range by shifting the date range of this object with
// iDateOffset.
@@ -51,24 +51,24 @@
// Create a new DoWStruct by shifting the DoWStruct of this object with
// iDateOffset.
const long lNbOfDaysOffset = iDateOffset.days();
- const DoWStruct_T& lDoW = getDoW();
- const DoWStruct_T lNewDoW = lDoW.shift (lNbOfDaysOffset);
+ const DoWStruct& lDoW = getDoW();
+ const DoWStruct lNewDoW = lDoW.shift (lNbOfDaysOffset);
- return PeriodStruct_T (lNewDateRange, lNewDoW);
+ return PeriodStruct (lNewDateRange, lNewDoW);
}
// ////////////////////////////////////////////////////////////////////
- PeriodStruct_T PeriodStruct_T::
- intersection (const PeriodStruct_T& iPeriodStruct) const {
+ PeriodStruct PeriodStruct::
+ intersection (const PeriodStruct& iPeriodStruct) const {
const DatePeriod_T lNewDateRange =
_dateRange.intersection (iPeriodStruct._dateRange);
- const DoWStruct_T lNewDoW = _dow.intersection (iPeriodStruct._dow);
+ const DoWStruct lNewDoW = _dow.intersection (iPeriodStruct._dow);
- return PeriodStruct_T (lNewDateRange, lNewDoW);
+ return PeriodStruct (lNewDateRange, lNewDoW);
}
// ////////////////////////////////////////////////////////////////////
- const bool PeriodStruct_T::isValid () const {
+ const bool PeriodStruct::isValid () const {
if (_dateRange.is_null() == false && _dow.isValid()) {
return true;
}
Modified: trunk/stdair/stdair/bom/PeriodStruct.hpp
===================================================================
--- trunk/stdair/stdair/bom/PeriodStruct.hpp 2010-10-14 13:37:06 UTC (rev 347)
+++ trunk/stdair/stdair/bom/PeriodStruct.hpp 2010-10-14 16:40:17 UTC (rev 348)
@@ -15,14 +15,14 @@
/** Define a departure period
<br> A period is defined by a date range and a day-of-week struct. */
- struct PeriodStruct_T : public StructAbstract {
+ struct PeriodStruct : public StructAbstract {
public:
// ////////// Getters /////////////
/** Retrieve the attributes. */
const DatePeriod_T& getDateRange () const {
return _dateRange;
}
- const DoWStruct_T& getDoW () const {
+ const DoWStruct& getDoW () const {
return _dow;
}
@@ -32,7 +32,7 @@
void setDateRange (const DatePeriod_T& iDateRange) {
_dateRange = iDateRange;
}
- void setDoW (const DoWStruct_T& iDoW) { _dow = iDoW; }
+ void setDoW (const DoWStruct& iDoW) { _dow = iDoW; }
public:
/** Display explicitly (e.g., "Mon.Tue.Wed.Thu.Fri."). */
@@ -44,28 +44,28 @@
public:
// /////////// Business Methods /////////////
/** Build a period struct from this period struct by adding a date offset. */
- PeriodStruct_T addDateOffset (const DateOffset_T&) const;
+ PeriodStruct addDateOffset (const DateOffset_T&) const;
/** Build a new period struct which is the intersection of two
period structs. */
- PeriodStruct_T intersection (const PeriodStruct_T&) const;
+ PeriodStruct intersection (const PeriodStruct&) const;
/** Return if the period is valid (i.e., valid date range and valid DoW). */
const bool isValid () const;
public:
/** Constructor. */
- PeriodStruct_T (const DatePeriod_T&, const DoWStruct_T&);
+ PeriodStruct (const DatePeriod_T&, const DoWStruct&);
/** Default constructors. */
- PeriodStruct_T ();
- PeriodStruct_T (const PeriodStruct_T&);
+ PeriodStruct ();
+ PeriodStruct (const PeriodStruct&);
/** Default destructor. */
- ~PeriodStruct_T () { }
+ ~PeriodStruct () { }
private:
// Attributes
DatePeriod_T _dateRange;
- DoWStruct_T _dow;
+ DoWStruct _dow;
};
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|