X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FMoof%2FBackend.hh;fp=src%2FMoof%2FBackend.hh;h=8209b069b06ba34fb26b999b0ed5644580fe5c6b;hb=e0c0a3b5e7337cde55e520801d2e59e03dc97d9c;hp=0000000000000000000000000000000000000000;hpb=ed5fcf5f1357fc42749408f705e9ec55531ff006;p=chaz%2Fyoink diff --git a/src/Moof/Backend.hh b/src/Moof/Backend.hh new file mode 100644 index 0000000..8209b06 --- /dev/null +++ b/src/Moof/Backend.hh @@ -0,0 +1,46 @@ + +/*] Copyright (c) 2009-2010, Charles McGarvey [************************** +**] All rights reserved. +* +* vi:ts=4 sw=4 tw=75 +* +* Distributable under the terms and conditions of the 2-clause BSD license; +* see the file COPYING for a complete text of the license. +* +**************************************************************************/ + +#ifndef _MOOF_BACKEND_HH_ +#define _MOOF_BACKEND_HH_ + + +namespace Mf { + + +class Error; + + +/* + * Some classes and subsystems require certain backend libraries to be + * initialized. This is the mechanism to accomplish that. Classes which + * rely on any backend libraries just need to instantiate this class as a + * member. Backend cleanup will occur automagically when there are no more + * instances. + */ + +class Backend +{ +public: + + Backend(); + Backend(const Backend& backend); + ~Backend(); + + static bool isInitialized(); + static const Error& getError(); +}; + + +} // namespace Mf + +#endif // _MOOF_BACKEND_HH_ +