OpenStudio:utilities
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Classes | Public Member Functions | Static Public Member Functions | List of all members
openstudio::Calendar Class Reference

#include <Calendar.hpp>

Public Member Functions

void addHoliday (const Date &date, const std::string &name)
 add a holiday More...
 
void addNamedDay (const Date &date, const std::string &name)
 add a non holiday named day More...
 
 Calendar ()
 default constructor, uses full assumed year More...
 
 Calendar (int year)
 constructor with year, uses full assumed year More...
 
 Calendar (const Date &startDate, const Date &endDate)
 constructor with start and end dates, [startDate, endDate] More...
 
void daylightSavings (const Date &daylightSavingsStart, const Date &daylightSavingsEnd)
 set daylight savings time, [daylightSavingsStart, daylightSavingsEnd) More...
 
Date endDate () const
 get the last date in the calendar More...
 
std::string getName (const Date &date) const
 get the name of date, return empty if not on calendar More...
 
bool includesDate (const Date &date) const
 does the calendar include this date, e.g. are they from the same year More...
 
bool isDaylightSavings (const Date &date) const
 is date within daylight savings More...
 
bool isHoliday (const Date &date) const
 is date a holiday More...
 
bool isNamedDay (const Date &date) const
 is the date named on the calendar, either holiday or non holiday More...
 
void standardDaylightSavings ()
 standard daylight savings time, [2nd Sunday in March, 1st Sunday in November) More...
 
void standardHolidays ()
 add a standard set of holidays More...
 
Date startDate () const
 get the first date in the calendar More...
 

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