#include "Bar.h" // static initialization SingleBar * SingleBar::ourBar = NULL; // constructor Bar::Bar() { m_isOpen = false; m_bottles = NULL; } // destructor Bar::~Bar() { // TODO } // try to open a bar bool Bar::open() { // already open! if( m_isOpen ) return false; m_isOpen = true; return true; } // try to close a bar bool Bar::close() { // already closed! if( !m_isOpen ) return false; m_isOpen = false; return true; } // constructor SingleBar::SingleBar() { cerr << "Bar()!" << endl; } // overloaded constructor SingleBar::SingleBar( const string & text ) { cerr << "Bar( " << text << " )!" << endl; } // destructor SingleBar::~SingleBar() { cerr << "bye!" << endl; } // getInstance SingleBar * SingleBar::getInstance() { if( ourBar == NULL ) ourBar = new SingleBar(); return ourBar; }