C:/nobackup/private/physical_svn/trunk/include/physical/formatspec.hpp

Go to the documentation of this file.
00001 
00002 /*=============================================================================
00003     physical quantities / units / constants
00004     Copyright (c) 2006, 2007 Martin Schulz
00005     http://physical.sourceforge.net
00006   
00007     This is private code by Martin Schulz.
00008   
00009     Use, modification and distribution is subject to the Boost Software
00010     License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
00011     http://www.boost.org/LICENSE_1_0.txt)
00012 =============================================================================*/
00013 
00014 #ifndef PHYSICAL_FORMATSPEC
00015 #define PHYSICAL_FORMATSPEC
00016 
00017 #include "physical/dynamicunit.hpp"
00018 
00019 namespace physical {
00020 
00021         namespace format {
00022 
00023       template<class UnitSystem>
00024                 struct FormatSpec {
00025                         typedef DynamicUnit<UnitSystem> unit_type;
00026 
00027                         std::string unitname; // FIXME: singularname + pluralname? language-dependend!
00028                         unit_type unit;
00029                         std::streamsize precision;
00030 
00031          template<typename T, class Exponents>
00032                         FormatSpec(std::string n, const FixedPhysical<UnitSystem, T, Exponents> u, std::size_t p)
00033                                 : unitname(n), unit(u), precision(static_cast<std::streamsize>(p)) {};
00034 
00035                         FormatSpec(std::string n, DynamicUnit<UnitSystem> u, std::streamsize p)
00036             : unitname(n), unit(u), precision(static_cast<std::streamsize>(p)) {};
00037                 };
00038 
00039         }; // namespace physical
00040 
00041 }; // namespace format
00042 
00043 #endif

Generated on Mon Apr 2 22:25:03 2007 for physical_svn by  doxygen 1.5.1-p1
hosted on SourceForge.net Logo