# HG changeset patch # User Chris Cannam # Date 1438512047 -3600 # Sun Aug 02 11:40:47 2015 +0100 # Node ID 313c39e40d2ac49dd7da19f68e65d260187c89a9 # Parent da0bbf33b07c5c4aae80139476667431e02f37e5 Build fixes and boilerplate diff --git a/bqthingfactory/ThingFactory.h b/bqthingfactory/ThingFactory.h --- a/bqthingfactory/ThingFactory.h +++ b/bqthingfactory/ThingFactory.h @@ -1,5 +1,34 @@ /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ -/* Copyright Chris Cannam - All Rights Reserved */ + +/* + bqthingfactory + + Copyright 2007-2015 Particular Programs Ltd. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, copy, + modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the names of Chris Cannam and + Particular Programs Ltd shall not be used in advertising or + otherwise to promote the sale, use or other dealings in this + Software without prior written authorization. +*/ #ifndef BQ_THING_FACTORY_H #define BQ_THING_FACTORY_H @@ -141,7 +170,7 @@ if (m_registry.find(uri) == m_registry.end()) { throw UnknownThingException(uri); } - return m_registry[uri]->build(p); + return m_registry.at(uri)->build(p); } Thing *createFor(std::string tag, Parameters p) const { @@ -168,7 +197,7 @@ } m_registry[uri] = builder; for (size_t i = 0; i < tags.size(); ++i) { - if (m_tags.find(tags[i]) != m_registry.end()) continue; + if (m_tags.find(tags[i]) != m_tags.end()) continue; std::cerr << "ThingFactory::registerBuilder: tag " << tags[i] << " -> " << uri << std::endl; m_tags[tags[i]] = uri;