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>
320 static const map<String, UnitName> &
giveDef();
321 static const map<String, UnitName> &
giveSI();
String: the storage and methods of handling collections of characters.
Define a struct containing the static data members.
map< String, UnitName > mapPref
Decimal prefix list.
Bool doneFITS
FITS unit list inclusion.
map< String, UnitName > mapDef
Defining SI unit list.
map< String, UnitName > mapCust
Customary list.
map< String, UnitName > mapUser
User defined unit list.
map< String, UnitName > mapSI
SI unit list.
static void initUMSI1(UMaps &)
static void initUMSI2(UMaps &)
static void listCache(ostream &os)
List all units in cache.
static UMaps & getMaps()
Get the static UMaps struct.
static const map< String, UnitName > & giveDef()
static const map< String, UnitName > & givePref()
Return the different maps.
static const map< String, UnitName > & giveSI()
static void putUser(const String &s, const UnitVal &val)
Define a user defined standard unit.
UnitMap(const UnitMap &other)
Copy constructor (not implemented)
UnitMap & operator=(const UnitMap &other)
Copy assignment (not implemented)
static void list(ostream &os)
List some part of the standard unit lists on cout or stream
static void listSI(ostream &os)
List all SI units.
static const map< String, UnitVal > & giveCache()
static void listPref(ostream &os)
List all prefixes.
static Unit toFITS(const Unit &un)
Translate to a FITS unit.
static Bool getNameFITS(const UnitName *&name, uInt which)
Get the name of a FITS unit.
static Bool getPref(const String &s, UnitName &name, UMaps *maps=0)
Check if a unit name is known, and return its value if True
static const map< String, UnitName > & giveUser()
static Unit fromFITS(const Unit &un)
Translate a FITS unit to the proper units.
static const map< String, UnitName > & giveCust()
static void listUser(ostream &os)
List all user defined units.
UnitMap()
Default constructor of maps.
static Bool getCache(const String &s, UnitVal &val)
Get a cached definition.
static void initUMCust1(UMaps &)
static void initUMCust2(UMaps &)
static void listDef(ostream &os)
List all defining units.
static map< String, UnitVal > & getMapCache()
Get the static mapCache object.
static void clearFITS()
Clear FITS related units from user list.
static void removeUser(const String &name)
Remove a user unit.
static void listCust(ostream &os)
List all customary units.
static Bool getUnit(const String &s, UnitName &name, UMaps *maps=0)
Get a standard unit definition (search order: User, Customary, SI)
static void initUMPrefix(UMaps &)
Bits and pieces of initUM() to get compilation speed improved.
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.
static void addFITS()
Define FITS related unit names.
static std::mutex fitsMutex
static void initUMCust3(UMaps &)
static void removeUser(const UnitName &name)
static const String & getStringFITS(uInt which)
Get the belonging unit to a FITS unit.
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.
const uInt N_FITS
Number of FITS units recognised (change the FITSstring and FITSunit lists in the UnitMap....