roo_quantity
API Documentation for roo_quantity
Loading...
Searching...
No Matches
roo_quantity::Charge Class Reference

Representation of charge, internally stored as floating-point Coulombs. More...

#include <charge.h>

Public Member Functions

 Charge ()
 Creates a charge object representing an 'unknown' charge.
 
float inKiloCoulombs () const
 Returns the charge in kiloCoulombs.
 
float inCoulombs () const
 Returns the charge in Coulombs.
 
float inMilliCoulombs () const
 Returns the charge in milliCoulombs.
 
float inMicroCoulombs () const
 Returns the charge in microCoulombs.
 
bool isUnknown () const
 Returns whether the object represents an unknown charge.
 
bool operator< (const Charge &other) const
 
bool operator== (const Charge &other) const
 
bool operator> (const Charge &other) const
 
bool operator<= (const Charge &other) const
 
bool operator>= (const Charge &other) const
 
bool operator!= (const Charge &other) const
 
Chargeoperator+= (const Charge &other)
 
Chargeoperator-= (const Charge &other)
 
Chargeoperator*= (float multi)
 
Chargeoperator/= (float div)
 

Friends

Charge UnknownCharge ()
 Returns a charge object representing an unknown charge.
 
Charge ChargeInCoulombs (float)
 Returns a charge object equivalent to the specified charge expressed in Coulombs.
 

Detailed Description

Representation of charge, internally stored as floating-point Coulombs.

Definition at line 19 of file charge.h.

Constructor & Destructor Documentation

◆ Charge()

roo_quantity::Charge::Charge ( )
inline

Creates a charge object representing an 'unknown' charge.

Definition at line 22 of file charge.h.

Member Function Documentation

◆ inCoulombs()

◆ inKiloCoulombs()

float roo_quantity::Charge::inKiloCoulombs ( ) const
inline

Returns the charge in kiloCoulombs.

Definition at line 25 of file charge.h.

◆ inMicroCoulombs()

float roo_quantity::Charge::inMicroCoulombs ( ) const
inline

Returns the charge in microCoulombs.

Definition at line 34 of file charge.h.

◆ inMilliCoulombs()

float roo_quantity::Charge::inMilliCoulombs ( ) const
inline

Returns the charge in milliCoulombs.

Definition at line 31 of file charge.h.

◆ isUnknown()

bool roo_quantity::Charge::isUnknown ( ) const
inline

Returns whether the object represents an unknown charge.

Definition at line 37 of file charge.h.

◆ operator!=()

bool roo_quantity::Charge::operator!= ( const Charge other) const
inline

Definition at line 55 of file charge.h.

◆ operator*=()

Charge & roo_quantity::Charge::operator*= ( float  multi)
inline

Definition at line 69 of file charge.h.

◆ operator+=()

Charge & roo_quantity::Charge::operator+= ( const Charge other)
inline

Definition at line 59 of file charge.h.

References inCoulombs().

◆ operator-=()

Charge & roo_quantity::Charge::operator-= ( const Charge other)
inline

Definition at line 64 of file charge.h.

References inCoulombs().

◆ operator/=()

Charge & roo_quantity::Charge::operator/= ( float  div)
inline

Definition at line 74 of file charge.h.

◆ operator<()

bool roo_quantity::Charge::operator< ( const Charge other) const
inline

Definition at line 39 of file charge.h.

◆ operator<=()

bool roo_quantity::Charge::operator<= ( const Charge other) const
inline

Definition at line 47 of file charge.h.

◆ operator==()

bool roo_quantity::Charge::operator== ( const Charge other) const
inline

Definition at line 41 of file charge.h.

◆ operator>()

bool roo_quantity::Charge::operator> ( const Charge other) const
inline

Definition at line 45 of file charge.h.

◆ operator>=()

bool roo_quantity::Charge::operator>= ( const Charge other) const
inline

Definition at line 51 of file charge.h.

Friends And Related Symbol Documentation

◆ ChargeInCoulombs

Charge ChargeInCoulombs ( float  charge)
friend

Returns a charge object equivalent to the specified charge expressed in Coulombs.

Definition at line 112 of file charge.h.

◆ UnknownCharge

Charge UnknownCharge ( )
friend

Returns a charge object representing an unknown charge.

Definition at line 102 of file charge.h.


The documentation for this class was generated from the following file: