Go to the documentation of this file.
28 #ifndef CASA_UNITMAP_H
29 #define CASA_UNITMAP_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/BasicSL/Constants.h>
35 #include <casacore/casa/stdmap.h>
36 #include <casacore/casa/BasicSL/String.h>
37 #include <casacore/casa/Quanta/UnitDim.h>
38 #include <casacore/casa/Quanta/UnitVal.h>
39 #include <casacore/casa/Quanta/UnitName.h>
40 #include <casacore/casa/OS/Mutex.h>
275 static void list(ostream &os);
293 static void listDef(ostream &os);
299 static void listSI(ostream &os);
318 static const map<String, UnitName> &
givePref();
319 static const map<String, UnitName> &
giveDef();
320 static const map<String, UnitName> &
giveSI();
321 static const map<String, UnitName> &
giveCust();
322 static const map<String, UnitName> &
giveUser();
323 static const map<String, UnitVal> &
giveCache();
contains all simple known physical units
UnitMap & operator=(const UnitMap &other)
Copy assignment (not implemented)
static void putUser(const String &s, const UnitVal &val)
Define a user defined standard unit.
static map< String, UnitVal > & getMapCache()
Get the static mapCache object.
static const map< String, UnitName > & giveDef()
static void initUMCust1(UMaps &)
static Bool getNameFITS(const UnitName *&name, uInt which)
Get the name of a FITS unit.
static Unit fromFITS(const Unit &un)
Translate a FITS unit to the proper units.
static Bool getUnit(const String &s, UnitName &name, UMaps *maps=0)
Get a standard unit definition (search order: User, Customary, SI)
static void addFITS()
Define FITS related unit names.
static Bool getPref(const String &s, UnitName &name, UMaps *maps=0)
Check if a unit name is known, and return its value if True.
describes any valid unit as a factor and a dimenion of SI units
static const map< String, UnitVal > & giveCache()
static void clearFITS()
Clear FITS related units from user list.
static void initUMSI2(UMaps &)
static void initUMSI1(UMaps &)
map< String, UnitName > mapCust
Customary list.
static const map< String, UnitName > & givePref()
Return the different maps.
map< String, UnitName > mapDef
Defining SI unit list.
static const map< String, UnitName > & giveUser()
Define a struct containing the static data members.
this file contains all the compiler specific defines
map< String, UnitName > mapSI
SI unit list.
static void initUMCust2(UMaps &)
static void initUMPrefix(UMaps &)
Bits and pieces of initUM() to get compilation speed improved.
UnitMap()
Default constructor of maps.
static const map< String, UnitName > & giveCust()
static void removeUser(const String &name)
Remove a user unit.
static const map< String, UnitName > & giveSI()
map< String, UnitName > mapUser
User defined unit list.
static void putCache(const String &s, const UnitVal &val)
Save a definition of a full unit name in the cache (the cache will be cleared if getting too large (2...
static void clearCache()
Clear out the cache.
Bool doneFITS
FITS unit list inclusion.
static const String & getStringFITS(uInt which)
Get the belonging unit to a FITS unit.
String: the storage and methods of handling collections of characters.
Wrapper around a pthreads mutex.
bool Bool
Define the standard types used by Casacore.
static UMaps & getMaps()
Get the static UMaps struct.
static Unit toFITS(const Unit &un)
Translate to a FITS unit.
static Bool getCache(const String &s, UnitVal &val)
Get a cached definition.
static void initUMCust3(UMaps &)
map< String, UnitName > mapPref
Decimal prefix list.
const uInt N_FITS
Number of FITS units recognised (change the FITSstring and FITSunit lists in the UnitMap....