/* -*- C++ -*- * Copyright ©2004 Hugo Mills * * This software is distributed under the terms of the GNU GPL v3 * For more information on the GPL, see the file COPYING or * visit http://www.gnu.org/ * * This software is distributed without warranty */ #ifndef CONFIGURATION_H #define CONFIGURATION_H #include #include #include #include "magellan/output.h" #include "magellan/configlexer.h" #include "config.h" #ifdef HAVE_BOOST_THREAD #include #include #endif class MDisplay; class Content; class XfOrbit; class XfMap; class XfView; class RenderContext; // Main class class Configuration { public: Configuration(ConfigLexer*); virtual ~Configuration(); void update(void); // Update orbital positions void render(void); // Render to the target bitmap void output(void); // Output the target bitmap bool repeated(void) const { return _output->repeated(); } time_t updatetime(void) const { return _output->updatetime(); } // Get plugins of type known at compile time XfOrbit* getorbit(const std::string&) const; XfMap* getprojection(const std::string&) const; XfView* getviewport(const std::string&) const; Content* getcontent(const std::string&) const; // Get plugins of arbitrary type template T* getplugin(const std::string&) const; // Return things from the head of the contexts list RenderContext* nextcontext(void); private: Output* _output; // The one output device std::map orbits; std::map content; std::map maps; std::map viewports; std::list displays; // Order gives Z-order int max_threads; #ifdef HAVE_BOOST_THREAD std::list::iterator currentcontext; boost::mutex contextlock; // Multiple rendering contexts not needed in the single-threaded // version void generatecontexts(void); void splitcontexts(void); void mergecontexts(void); std::list contexts; #endif template void bindall(Iter begin, Iter end); }; #endif