From GridLAB-D Wiki
gld_unit - C++ Module API for units Template:NEW30
Synopsis
class gld_unit { private: // data UNIT core; public: // constructors/casts operator UNIT*(void); public: // read accessors char* get_name(void); double get_c(void); double get_e(void); double get_h(void); double get_k(void); double get_m(void); double get_s(void); double get_a(void); double get_b(void); int get_prec(void); public: // iterators bool is_last(void); gld_unit* get_next(void); };
Description
The gld_unit class is simply a cast of the UNIT structure.
convert
- bool convert(char* name, double &value)
- bool convert(UNIT* unit, double &value)
- bool convert(gld_unit &unit, double &value)
- Convert a value given to a new unit.
get_a
- double get_a(void)
- Retrieve the scalar of the unit.
get_b
- double get_b(void)
- Retrieve the bias of the unit.
get_c
- double get_c(void)
- Retrieve the exponent to the unit constant c.
get_e
- double get_e(void)
- Retrieve the exponent to the unit constant e.
get_h
- double get_h(void)
- Retrieve the exponent to the unit constant h.
get_k
- double get_k(void)
- Retrieve the exponent to the unit constant k.
get_m
- double get_m(void)
- Retrieve the exponent to the unit constant m.
get_name
- char* get_name(void)
- Retrieve the name assigned to the unit.
get_next
get_prec
- int get_prec(void)
- Retrieve the precision of the unit.
get_s
- double get_s(void)
- Retrieve the exponent to the unit constant s.
gld_type
- gld_type(char *name)
- Construct a unit handler.
is_last
- bool is_last(void)
- Determine whether the unit is the last in the unit list.
UNIT
Version
The C++ Module API was introduced in Hassayampa (Version 3.0) to support multithreaded modules.