OpenStudioCore:utilities
 AllClasses Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages

#include "Calendar.hpp"

Public Member Functions

void addHoliday (const Date &date, const std::string &name)
void addNamedDay (const Date &date, const std::string &name)
 Calendar ()
 Calendar (int year)
 Calendar (const Date &startDate, const Date &endDate)
void daylightSavings (const Date &daylightSavingsStart, const Date &daylightSavingsEnd)
Date endDate () const
std::string getName (const Date &date) const
bool includesDate (const Date &date) const
bool isDaylightSavings (const Date &date) const
bool isHoliday (const Date &date) const
bool isNamedDay (const Date &date) const
void standardDaylightSavings ()
void standardHolidays ()
Date startDate () const

Static Public Member Functions

static openstudio::LogChannel logChannel ()

Detailed Description

Calendar is a description of a year, noting special days like holidays, special periods like seasons, and daylight savings time.

Constructor & Destructor Documentation

openstudio::Calendar::Calendar ( )

default constructor, uses full assumed year

openstudio::Calendar::Calendar ( int  year)

constructor with year, uses full assumed year

openstudio::Calendar::Calendar ( const Date startDate,
const Date endDate 
)

constructor with start and end dates, [startDate, endDate]

Member Function Documentation

void openstudio::Calendar::addHoliday ( const Date date,
const std::string &  name 
)

add a holiday

void openstudio::Calendar::addNamedDay ( const Date date,
const std::string &  name 
)

add a non holiday named day

void openstudio::Calendar::daylightSavings ( const Date daylightSavingsStart,
const Date daylightSavingsEnd 
)

set daylight savings time, [daylightSavingsStart, daylightSavingsEnd)

Date openstudio::Calendar::endDate ( ) const

get the last date in the calendar

std::string openstudio::Calendar::getName ( const Date date) const

get the name of date, return empty if not on calendar

bool openstudio::Calendar::includesDate ( const Date date) const

does the calendar include this date, e.g. are they from the same year

bool openstudio::Calendar::isDaylightSavings ( const Date date) const

is date within daylight savings

bool openstudio::Calendar::isHoliday ( const Date date) const

is date a holiday

bool openstudio::Calendar::isNamedDay ( const Date date) const

is the date named on the calendar, either holiday or non holiday

static openstudio::LogChannel openstudio::Calendar::logChannel ( )
inlinestatic
void openstudio::Calendar::standardDaylightSavings ( )

standard daylight savings time, [2nd Sunday in March, 1st Sunday in November)

void openstudio::Calendar::standardHolidays ( )

add a standard set of holidays

Date openstudio::Calendar::startDate ( ) const

get the first date in the calendar