StdAir Logo  1.00.3
C++ Standard Airline IT Object Library
stdair::DoWStruct Struct Reference

#include <stdair/bom/DoWStruct.hpp>

+ Inheritance diagram for stdair::DoWStruct:

Public Types

typedef std::vector< bool > BooleanList_T
 

Public Member Functions

bool getDayOfWeek (const unsigned short i) const
 
bool getStandardDayOfWeek (const unsigned short i) const
 
void setDayOfWeek (const unsigned short, const bool)
 
const std::string describe () const
 
const std::string describeShort () const
 
DoWStruct shift (const long &) const
 
DoWStruct intersection (const DoWStruct &) const
 
const bool isValid () const
 
 DoWStruct (const std::string &iDowString)
 
 DoWStruct ()
 
 DoWStruct (const DoWStruct &)
 
 ~DoWStruct ()
 
void toStream (std::ostream &ioOut) const
 
virtual void fromStream (std::istream &ioIn)
 

Detailed Description

Define a Day Of the Week (DoW) sequence.
For instance, 1..11.1 means that the period is active on Mon., Thu., Fri. and Sun.

Definition at line 18 of file DoWStruct.hpp.

Member Typedef Documentation

typedef std::vector<bool> stdair::DoWStruct::BooleanList_T

Define the bit set representing the DoW.

Definition at line 21 of file DoWStruct.hpp.

Constructor & Destructor Documentation

stdair::DoWStruct::DoWStruct ( const std::string &  iDowString)

Constructor from a given bit set (e.g., "0000011" for the week-ends).

Definition at line 21 of file DoWStruct.cpp.

stdair::DoWStruct::DoWStruct ( )

Default constructors.

Definition at line 14 of file DoWStruct.cpp.

stdair::DoWStruct::DoWStruct ( const DoWStruct iDowStruct)

Definition at line 34 of file DoWStruct.cpp.

stdair::DoWStruct::~DoWStruct ( )
inline

Default destructor.

Definition at line 63 of file DoWStruct.hpp.

Member Function Documentation

bool stdair::DoWStruct::getDayOfWeek ( const unsigned short  i) const

Get the i-th day of the week (Monday being the first one).

Definition at line 66 of file DoWStruct.cpp.

Referenced by intersection(), and isValid().

bool stdair::DoWStruct::getStandardDayOfWeek ( const unsigned short  i) const

Get the i-th day of the week (Sunday being the first one).

Definition at line 71 of file DoWStruct.cpp.

void stdair::DoWStruct::setDayOfWeek ( const unsigned short  i,
const bool  iBool 
)

Set the new value for the i-th day-of-week.

Definition at line 82 of file DoWStruct.cpp.

Referenced by intersection(), and shift().

const std::string stdair::DoWStruct::describe ( ) const
virtual

Display explicitly (e.g., "Mon.Tue.Wed.Thu.Fri.").

Implements stdair::StructAbstract.

Definition at line 52 of file DoWStruct.cpp.

References stdair::DOW_STR.

Referenced by stdair::PeriodStruct::describe().

const std::string stdair::DoWStruct::describeShort ( ) const

Display as a bit set (e.g., "1111100").

Definition at line 40 of file DoWStruct.cpp.

Referenced by stdair::PeriodStruct::describeShort().

DoWStruct stdair::DoWStruct::shift ( const long &  iNbOfDays) const

Build a new DoW struct by shifting the current DoW by a given number.

Definition at line 88 of file DoWStruct.cpp.

References stdair::DEFAULT_DOW_STRING, and setDayOfWeek().

Referenced by stdair::PeriodStruct::addDateOffset().

DoWStruct stdair::DoWStruct::intersection ( const DoWStruct iDoW) const

Build a new DoW struct by intersecting two DoW structs.

Definition at line 104 of file DoWStruct.cpp.

References stdair::DEFAULT_DOW_STRING, getDayOfWeek(), and setDayOfWeek().

Referenced by stdair::PeriodStruct::intersection().

const bool stdair::DoWStruct::isValid ( ) const

Return if the DoW struct is valid (i.e., has at least one "true").

Definition at line 117 of file DoWStruct.cpp.

References getDayOfWeek().

Referenced by stdair::PeriodStruct::isValid().

void stdair::StructAbstract::toStream ( std::ostream &  ioOut) const
inlineinherited

Dump a Business Object into an output stream.

Parameters
ostream&the output stream.

Definition at line 29 of file StructAbstract.hpp.

References stdair::StructAbstract::describe().


The documentation for this struct was generated from the following files: