common.h File Reference
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <map>
#include <set>
#include <vector>
Go to the source code of this file.
Classes |
struct | deletePtr< T > |
| Template function to dealloc a container which owns a list of pointer to object. More...
|
class | Singleton< T > |
| A singleton is perhaps the simplest design pattern, common to many programming languages and it’s the way to allow one and only one instance of a class. More...
|
Defines |
#define | CLEAR_SCREEN_CMD "clear" |
#define | LOG(L,...) |
#define | LOG_CTOR() LOG(3, "ctor called\n") |
#define | LOG_DTOR() LOG(3, "dtor called\n") |
Typedefs |
typedef std::set< std::string > | StringSet |
typedef std::vector< size_t > | IntVector |
Functions |
template<class InputIterator , class T > |
T | valueMerge (InputIterator first, InputIterator last, T delim) |
| Merge container values, delimited by a separator.
|
Variables |
int | debugLevel |
Define Documentation
#define CLEAR_SCREEN_CMD "clear" |
Referenced by UserMenu::addNewCategory(), UserMenu::addNewProduct(), UserMenu::browseProductCatalog(), UserMenu::deleteProduct(), UserMenu::disableUser(), UserMenu::displayAdminMenu(), UserMenu::displayMonthlyTrend(), UserMenu::displayUnprivilegedMenu(), UserMenu::login(), UserMenu::mainMenu(), UserMenu::placeNewOrder(), UserMenu::registerNewUser(), UserMenu::showConfigurationByProduct(), UserMenu::showProductDetail(), and UserMenu::showUserProfile().
Value:if (L <= debugLevel) { \
printf("[%s:%d] [%s] ", __FILE__, \
__LINE__, __func__); \
printf(__VA_ARGS__); \
}
Referenced by Observable::addObserver(), Order::create(), AdminUser::deleteProduct(), Observable::didChangeValueForKey(), DataModel::keysForEntity(), Observable::removeObserver(), ManagedObject::store(), ManagedObject::update(), UserMenu::UserMenu(), and Observable::willChangeValueForKey().
#define LOG_CTOR |
( |
|
) |
LOG(3, "ctor called\n") |
Referenced by AdminUser::AdminUser(), Basket::Basket(), Category::Category(), Database::Database(), DataModel::DataModel(), ManagedObject::ManagedObject(), NormalUser::NormalUser(), Observable::Observable(), Order::Order(), Product::Product(), User::User(), and UserMenu::UserMenu().
#define LOG_DTOR |
( |
|
) |
LOG(3, "dtor called\n") |
Typedef Documentation
Function Documentation
template<class InputIterator , class T >
T valueMerge |
( |
InputIterator |
first, |
|
|
InputIterator |
last, |
|
|
T |
delim | |
|
) |
| | [inline] |
Merge container values, delimited by a separator.
The function valueMerge need an iterator associated to the container, an iterator that points to the end of it and a string used as separator; a common use of this function is to obtain a string starting from a container, such as a vector or a set.
Referenced by ManagedObject::update().
Variable Documentation