// systemtap grapher // Copyright (C) 2009 Red Hat Inc. // // This file is part of systemtap, and is free software. You can // redistribute it and/or modify it under the terms of the GNU General // Public License (GPL); either version 2, or (at your option) any // later version. #ifndef SYSTEMTAP_GRAPHER_TIME_HXX #define SYSTEMTAP_GRAPHER_TIME_HXX 1 #include #include namespace systemtap { template class Singleton { public: static T& instance() { static T _instance; return _instance; } protected: Singleton() {} private: // Insure that singleton is constructed before main() is called. struct InstanceBuilder { InstanceBuilder() { instance(); } }; static InstanceBuilder _instanceBuilder; }; template typename Singleton::InstanceBuilder Singleton::_instanceBuilder; class Time : public Singleton