factory.h revision d0f5da1e642fd62504eab90ef684c3403356781c
/** @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);
return NULL;
}
}
};
struct NodeTraits {
name = "string";
break;
if (sptype) {
} else {
}
break;
}
default:
name = "";
break;
}
return name;
}
};
#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 :