factory.h revision 6afde8674707ca6bde7835c5a6e4f182daf789af
/** @file
* Generic Factory
*//*
* Authors:
* Markus Engel
*
* Copyright (C) 2013 Authors
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifndef FACTORY_H_SEEN
#define FACTORY_H_SEEN
#include <exception>
#include <map>
#include <string>
/**
* A simple singleton implementation.
*/
struct Singleton {
static T &instance() {
static T inst;
return inst;
}
};
, _type_string(type) {
}
}
return _type_string.c_str();
}
};
} // namespace FactoryExceptions
/**
* A Factory for creating objects which can be identified by strings.
*/
typedef BaseObject *CreateFunction();
}
typename std::map<std::string const, CreateFunction *>::const_iterator it = this->_object_map.find(id);
//throw FactoryExceptions::TypeNotRegistered(id);
|| id == "inkscape:_templateinfo")) {
}
return NULL;
}
}
};
#endif
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :