just a quick note, which day is everybody planning on going ?? knowing my luck I'll turn up on the wrong day !!!
Sz
Hi All, I'm going down on Wednesday. I thought a mass meetup would be good, Could we all 'do lunch' or something (that isn't how it probably sounds - <cringes>). A good chance to compare freebies and get some suggestions of stands to visit and that sort of thing. Have set out below a functional C++ code framework. Feel Free to edit to include yourself ... I have commented where to do this, a simple copy and paste replacing details with your own should suffice
/* File : ExpoMeet.h Author : earl brannigan Purpose: Linux Expo ALUG Meetup Version : 0.1 date : 28th June 2001 */
typedef struct _food { ong Baguette; short Coffee; void eat() { Baguette --; //poss result in -ve value of one item, relies on sense of alugite to avoid consuming self or food container Coffee --; } //a boolean to tell if there is still Food bool operator == (bool){ return (Baguette || Coffee);} }FoodType;
//some externals for buying lunch extern long buycoffee(); extern long buysarnie();
class MeetUp { private : FoodType* food; protected : public : MeetUp():food(new FoodType()) {} long lunch() { food.coffee = buycoffee(); food.Baguette = buysarmie(); long Time(0); while(food == true) { food->eat(); Time++; } return Time; } };
//singleton alug member (only one instance of each - thankfully) template <const string N, const int max_goodies> class Alugite{ private : static Alugite* INSTANCE; string name; bool satisfied; std::list<string> goodies; MeetUp* Meet; //private constr ... well you wouldn't want it to be public now Alugite():name(N),Meet(new MeetUp()), satisfied(false), goodies(){}
void GetGoodies () { cin >> goodies;}
void ShowGoodies() { cout << goodies << endl; }
public : static Alugite* GetInstance(){return INSTANCE = (NULL ? new Alugite() : INSTANCE);} void mingle() { while (!satisfied) { GetGoodies(); satisfied = (goodies.size() >= max_goodies); //finish when we can't carry any more } } void DoMeet() { Meet->lunch(); ShowGoodies(); //generate envy satisfied = false; //reset satisfied for afternoon session } };
//add yourself to this list of typedefs, specify your name and the max_goodies you can get in a session to complete the template typedef Alugite <"Earl", 100> Earl; typedef Alugite <"Jo", 100> Jo; typedef Alugite <"Neill", 100> Neill; typedef Alugite <"Martyn", 100> Martyn; typedef Alugite <"Adam", 100> Adam; typedef Alugite <"David", 100> David;
//declare yourself a member of _alug typedef struct _alug{ { Earl* earl; Jo* jo; Neill* neill; Martyn* martyn; Adam* adam; //constructor ... add yourself here or you don't exist _alug(){ //retrieve the static INSTANCE of each member earl = Earl::GetInstance(); jo = Jo::GetInstance(); neill = Neill::GetInstance(); martyn = Martyn::GetInstance(); adam = Adam::GetInstance(); } }alug;
/*main .cc */
//Make sure you mingle and meet by adding yourself to main void main(void) { //TODO : thread Alugite mingles and meet for true concurrency alug* ALUG = new alug();
//Morning Mingles ALUG->earl->Mingle(); ALUG->jo->Mingle(); ALUG->neill->Mingle(); ALUG->martyn->Mingle(); ALUG->adam->Mingle();
//Dinner ALUG->earl->DoMeet(); ALUG->jo->DoMeet(); ALUG->neill->DoMeet(); ALUG->martyn->DoMeet(); ALUG->adam->DoMeet();
//Afternoon Mingles ALUG->earl->Mingle(); ALUG->jo->Mingle(); ALUG->neill->Mingle(); ALUG->martyn->Mingle(); ALUG->adam->Mingle();
//eveyone done and going home delete ALUG;
}
Cheers Earl
-- Open Source Specialists http://www.entora.co.uk/ Tel: +44 (0)701 0723686 Fax: +44 (0)870 3214368