27 #ifndef SCHNEK_BLOCKCLASSES_HPP_ 28 #define SCHNEK_BLOCKCLASSES_HPP_ 34 #include "../exception.hpp" 36 #include <boost/shared_ptr.hpp> 50 virtual pBlock makeBlock(
const std::string &name) = 0;
52 typedef boost::shared_ptr<BlockFactory> pBlockFactory;
58 pBlock makeBlock(
const std::string &name)
69 std::set<std::string> allowedChildren;
70 pBlockFactory blockFactory;
72 void doAddChild(std::string child);
89 bool hasChild(std::string child);
91 template<
class B>
void setClass()
97 bool hasBlockFactory() {
return (
bool)blockFactory; }
98 pBlock makeBlock(
const std::string &name) {
return blockFactory->makeBlock(name); }
101 typedef boost::shared_ptr<BlockClassDescriptor> pBlockClassDescriptor;
106 typedef std::map<std::string, pBlockClassDescriptor> BlockClassDescriptors;
107 boost::shared_ptr<BlockClassDescriptors> classDescriptors;
111 BlockClasses(
bool restr_ =
true) : classDescriptors(
new BlockClassDescriptors), restr(restr_) {}
113 : classDescriptors(blockClasses.classDescriptors), restr(blockClasses.restr) {}
119 bool hasChild(std::string parent, std::string child);
120 bool restrictBlocks() {
return restr;}
125 #endif // SCHNEK_BLOCKCLASSES_HPP_ Definition: blockclasses.hpp:55
Definition: blockclasses.hpp:40
Definition: blockclasses.hpp:103
Definition: blockclasses.hpp:66
Definition: blockclasses.hpp:46
Definition: exception.hpp:33
Definition: blockclasses.hpp:74