/* name: timestamp_main.cxx author: the C++ course @X purpose: example for INF585 - time stamp main source: GNU C++ history: 100126 work started */ #include #include "timestamp.h" void AccessTimeStamp(TimeStamp& t) { using namespace std; cout << "friend access of a private property: " << t.timestamp << endl; t.timestamp++; } int main(int argc, char **argv) { using namespace std; int ret = 0; TimeStamp theTimeStamp; try { theTimeStamp.update(); } catch (...) { cout << "update exception caught in main" << endl; } long theTime = theTimeStamp.get(); cout << theTime << endl; //theTimeStamp.timestamp = 0; AccessTimeStamp(theTimeStamp); AccessTimeStamp(theTimeStamp); AccessTimeStamp(theTimeStamp); return ret; }