Declare a new quantity

saf_declare_quantity is a function defined in quant.c.

Synopsis:

SAF_Quantity * saf_declare_quantity(SAF_ParMode pmode, SAF_Db *db, const char *description, const char *abbreviation, const char *url, SAF_Quantity *quant)

Formal Arguments:

  • description: A short description of the new quantity (e.g., “volume per time”).
  • abbreviation: An optional abbreviation or symbol name for the quantity.
  • url: An optional url to the quantity documentation.
  • quant: [OUT] Optional quantity handle to initialize (and return).

Description: This function declares a new quantity whose product of powers is unity. The client is expected to multiply powers of other quantities into this new quantity (via saf_multiply_quantity) in order to complete its definition.

Preconditions:

  • pmode must be valid. (low-cost)

Return Value: A new quantity handle is returned on success. Otherwise a SAF__ERROR_HANDLE value is returned or an exception is raised, depending on the error handling property of the library.

Parallel Notes: This function must be called collectively in the database communicator.

See Also: