qtty-cpp
Header-only C++ wrapper for qtty
Loading...
Searching...
No Matches
qtty.hpp File Reference

Main header for the qtty C++ wrapper library. More...

#include "ffi_core.hpp"
#include "units/length.hpp"
#include "units/time.hpp"
#include "units/angular.hpp"
#include "units/mass.hpp"
#include "units/power.hpp"
#include "units/velocity.hpp"
#include "literals.hpp"
Include dependency graph for qtty.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  qtty
 

Functions

uint32_t qtty::abi_version ()
 Get the ABI version of the underlying qtty-ffi library.
 

Variables

struct { 
 
   int   qtty::major = 0 
 
   int   qtty::minor = 1 
 
   int   qtty::patch = 0 
 
qtty::version 
 Library version information.
 

Detailed Description

Main header for the qtty C++ wrapper library.

This header provides a modern, type-safe C++ interface to the qtty-ffi library. It includes:

  • Template-based Quantity class with compile-time unit checking
  • Operator overloading for natural arithmetic syntax
  • User-defined literals for convenient quantity creation
  • Support for length, time, angular, and compound (velocity) units

Usage example:

using namespace qtty;
// Create quantities using constructors or literals
Meter distance(1000.0);
auto time = 20.0_s;
// Perform arithmetic operations
auto doubled = distance * 2.0;
// Convert units
// Create compound units (velocity)
Quantity< typename ExtractTag< TargetType >::type > to() const
Definition ffi_core.hpp:171

Definition in file qtty.hpp.