When my program starts, I want it to immediately fill the “Calendar” class with all years/months/days from 1/1/1875 until 31/12/2025. I’m having trouble creating this “Calendar” class, I don’t really know what my options are with C++.

What’s the best way to realize this? Should the day/month/year be a multimap, and if so; how can I efficiently use that multimap to achieve what I’m trying to do (can multimaps even hold more than 2 objects?)? Or maybe the class shouldn’t be a class at all, but the whole thing should be turned into a multimap?
I made this “calendar” project up as an example, but I think my question really comes down to:
“How do I design a class (or alternative) that can hold multiple layers of data that are linked and easy to control/access”.
And by ‘control’ I mean add/delete/check-if-already-exists etc.
So maybe something like this (ignoring my example in the picture):
calendar.addYear(1998) //Add 1998 to the year stack (array?) inside the "calendar" object.
calendar.addMonth(1,0) //Add month 1 (january) to month stack (array?) keeping year-array position 0 as a reference, so we know what year this month belongs to.
calendar.addDay(1,0) //Add day 1 to day stack (array?) keeping month-array position 0 as a reference, so we know which month this day belongs to.
An example of something that I would want to programatically achieve with a class like this is:
//This is a magical GUI object I just made up ;D
myGUIofChoiceCreateSomeGUIobject GUIobject;
int i;
for(i=0; i < calendar.yearCount; i++;)
{
GUIobject.addYeartoGUIobject(calendar.year[i]); //Add current year to our GUI. The user can now select it, hooray!
addMonthsToYear(i); //Add months belonging to this year to our GUI.
}
addMonthsToYear(int theYear)
{
int i;
for(i=0; i < calendar.year[theYear].monthCount; i++;)
{
/*
Our made-up GUI will add the current month to the year we received as an
argument. As long as that year is selected in the GUI, our user can pick this month,
hooray!
*/
GUIobject.addMonthToGUIobject(calendar.year[theYear].month[i])
addDaysToMonth(i,theYear) //Add days to this month (not typing this one down, you can see where this is going)
}
}
And as if all of this wasn’t complicated enough; what is a calendar without to-do items? So the “calendar.day” needs to linked to an array/multimap/whatever of objects, which could look like this:
struct stuffToDo{
std::string message;
float time;
}
after which it should be easy to add an object like that to the class:
stuffToDo newstuff;
newstuff.message = "Find a C++ tutor so you can stop bothering stackoverflow";
newstuff.time = 15.20;
calendar.year[2012].month[11].day[18].addObject(newstuff);
I’m at a loss, what are my options here?
PS. I’m sorry for the inconsistency between my examples, but it was kind of inevitable without knowing what I’m supposed to do, which is the essence of this question.
Boost library is what you need to look at..
And to help yourself you can find the
calendar class you wanna to make here
http://sourceforge.net/projects/c-cpp-calender/