Gromacs  2019-beta2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::TimeUnitManager Class Reference

#include <gromacs/options/timeunitmanager.h>


Provides common functionality for time unit conversions.

Methods/objects that need to deal with time units can either take a TimeUnitManager object, or they can take a TimeUnit value and construct a TimeUnitManager object internally.

Default copy constructor and assignment are used: the copy is an independent object that is initialized with the same time unit as the original.

This class is independent of the options implementation. To ease reuse, it could be moved to the utility module, and only TimeUnitBehavior left here.

Public Member Functions

 TimeUnitManager ()
 Creates a time unit manager with the default (ps) time unit.
 TimeUnitManager (TimeUnit unit)
 Creates a time unit manager with the given time unit.
TimeUnit timeUnit () const
 Returns the currently selected time unit.
void setTimeUnit (TimeUnit unit)
 Set a new time unit for the manager.
const char * timeUnitAsString () const
 Returns a string constant corresponding to the current time unit.
double timeScaleFactor () const
 Returns the scaling factor to convert times to ps.
double inverseTimeScaleFactor () const
 Returns the scaling factor to convert times from ps.

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