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> 253 static void list(ostream &os);
271 static void listDef(ostream &os);
277 static void listSI(ostream &os);
296 static const map<String, UnitName> &
givePref();
297 static const map<String, UnitName> &
giveDef();
298 static const map<String, UnitName> &
giveSI();
299 static const map<String, UnitName> &
giveCust();
300 static const map<String, UnitName> &
giveUser();
301 static const map<String, UnitVal> &
giveCache();
322 static map<String, UnitName> *
mapSI;
Wrapper around std::call_once.
static unsigned long count
const uInt N_FITS
Number of FITS units recognised (change the FITSstring and FITSunit lists in the UnitMap.cc when changing this number.
static void initUMPrefix()
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 addFITS()
Define FITS related unit names.
static const map< String, UnitName > & giveDef()
static Unit fromFITS(const Unit &un)
Translate a FITS unit to the proper units.
static map< String, UnitName > * mapDef
Defining SI unit list.
static const String & getStringFITS(uInt which)
Get the belonging unit to a FITS unit.
static const map< String, UnitName > & givePref()
Return the different maps.
describes any valid unit as a factor and a dimenion of SI units
static void clearCache()
Clear out the cache.
static map< String, UnitName > * mapSI
SI unit list.
static map< String, UnitName > * mapUser
User defined unit list.
static void putUser(const String &s, const UnitVal &val)
Define a user defined standard unit.
static map< String, UnitName > * mapCust
Customary list.
static void initUMCust3()
UnitMap & operator=(const UnitMap &other)
Copy assignment (not implemented)
contains all simple known physical units
static void initUMCust2()
static Bool getNameFITS(const UnitName *&name, uInt which)
Get the name of a FITS unit.
static void initUM()
Initialise the static maps.
static void releaseUM()
Remove all maps (just to get no memory leaks at end of program)
static const map< String, UnitVal > & giveCache()
static void initUMCust1()
bool Bool
Define the standard types used by Casacore.
static const map< String, UnitName > & giveUser()
static const map< String, UnitName > & giveCust()
static void removeUser(const String &name)
Remove a user unit.
static void doInitUM(void *)
static Bool getPref(const String &s, UnitName &name)
Check if a unit name is known, and return its value if True.
static Bool getUnit(const String &s, UnitName &name)
Get a standard unit definition (search order: User, Customary, SI)
static struct casacore::unit_map_initialize_ unit_map_initialize_instance_
Wrapper around a pthreads mutex.
String: the storage and methods of handling collections of characters.
static map< String, UnitName > * mapPref
Decimal prefix list.
static map< String, UnitVal > * mapCache
Cached list.
static Bool getCache(const String &s, UnitVal &val)
Get a cached definition.
static CallOnce0 theirCallOnce
Object to ensure safe multi-threaded lazy single initialization.
static Unit toFITS(const Unit &un)
Translate to a FITS unit.
static Bool doneFITS
FITS unit list inclusion.
static const map< String, UnitName > & giveSI()
static void clearFITS()
Clear FITS related units from user list.
this file contains all the compiler specific defines
UnitMap()
Default constructor of maps.