Version Class Reference

A class representing an interface version number. More...

#include <Version.h++>

List of all members.

Public Member Functions

 Version (const String &version) throw ()
 Construct a new Version from the specified string representation.
 Version (uint_t current=0, uint_t revision=0, uint_t age=0) throw ()
 Construct a new Version for the given components.
 Version (const Version &other) throw ()
 Copy constructor.
virtual ~Version () throw ()
 Destructor.
bool satisfies (const Version &requested) const throw ()
 Determine if an interface with this version satisfies a request for an interface with a specific requested version (i.e., if it is API-compatible with the requested interface).
bool satisfiedBy (const Version &available) const throw ()
 Determine if a requested interface with this version is satisfied by a specific available version (i.e., if the available interface is API-compatible with the requested version of the interface).
uint_t getCurrent () const throw ()
 Get the current component of the version.
uint_t getRevision () const throw ()
 Get the revision component of the version.
uint_t getAge () const throw ()
 Get the age component of the version.
void interfacesAdded () throw ()
 Adjust the version to reflect the addition of new interfaces.
void interfacesRemoved () throw ()
 Adjust the version to reflect the removal of existing interfaces.
void interfacesChanged () throw ()
 Adjust the version to reflect non-backward-compatible changes to the interfaces.
void implementationChanged () throw ()
 Adjust the version to reflect internal implementation changes.
String toString () const
 Get a String representation of the version, in C-A.A.R form.
String toCRAString () const
 Get a String representation of the version, in C:R:A form.
void fromString (const String &version) throw ()
 Parse the verison from a String.
bool operator== (const Version &other) const throw ()
 Equality operator.
bool operator!= (const Version &other) const throw ()
 Inequality operator.
bool operator< (const Version &other) const throw ()
 Determine if this Version is older than another version.
bool operator<= (const Version &other) const throw ()
 Determine if this Version is older than or equal to another version.
bool operator> (const Version &other) const throw ()
 Determine if this Version is newer than another version.
bool operator>= (const Version &other) const throw ()
 Determine if this Version is newer than or equal to another version.
Versionoperator= (const Version &other) throw ()
 Assignment operator.

Detailed Description

A class representing an interface version number.

The version number consists of three components:

These three components are not to be interpreted as major version, minor version, and build number.

A version begins at 0:0:0. The version number changes according to the following rules:

Author:
Mark Lindner

Constructor & Destructor Documentation

Version ( const String version  )  throw ()

Construct a new Version from the specified string representation.

Parameters:
version The string representation of a version, in the form C:R:A or C-A.A.R. For example, 9:0:6 and 3.6.0 are equivalent.
Version ( uint_t  current = 0,
uint_t  revision = 0,
uint_t  age = 0 
) throw ()

Construct a new Version for the given components.

Parameters:
current The current component.
revision The revision component.
age The age component, which must always be less than or equal to current; if an invalid age is specified, the value of current is used for age.
Version ( const Version other  )  throw ()

Copy constructor.

~Version (  )  throw () [virtual]

Destructor.


Member Function Documentation

void fromString ( const String version  )  throw ()

Parse the verison from a String.

uint_t getAge (  )  const throw () [inline]

Get the age component of the version.

uint_t getCurrent (  )  const throw () [inline]

Get the current component of the version.

uint_t getRevision (  )  const throw () [inline]

Get the revision component of the version.

void implementationChanged (  )  throw ()

Adjust the version to reflect internal implementation changes.

void interfacesAdded (  )  throw ()

Adjust the version to reflect the addition of new interfaces.

void interfacesChanged (  )  throw ()

Adjust the version to reflect non-backward-compatible changes to the interfaces.

void interfacesRemoved (  )  throw ()

Adjust the version to reflect the removal of existing interfaces.

bool operator!= ( const Version other  )  const throw () [inline]

Inequality operator.

bool operator< ( const Version other  )  const throw ()

Determine if this Version is older than another version.

bool operator<= ( const Version other  )  const throw () [inline]

Determine if this Version is older than or equal to another version.

Version & operator= ( const Version other  )  throw ()

Assignment operator.

bool operator== ( const Version other  )  const throw ()

Equality operator.

bool operator> ( const Version other  )  const throw ()

Determine if this Version is newer than another version.

bool operator>= ( const Version other  )  const throw () [inline]

Determine if this Version is newer than or equal to another version.

bool satisfiedBy ( const Version available  )  const throw ()

Determine if a requested interface with this version is satisfied by a specific available version (i.e., if the available interface is API-compatible with the requested version of the interface).

Parameters:
available The version that is available.
Returns:
true if an interface with the available version can be used by a caller requesting this version, false otherwise.
bool satisfies ( const Version requested  )  const throw ()

Determine if an interface with this version satisfies a request for an interface with a specific requested version (i.e., if it is API-compatible with the requested interface).

Parameters:
requested The requested version.
Returns:
true if an interface with this version can be used by a caller requesting the requested version, false otherwise.
String toCRAString (  )  const

Get a String representation of the version, in C:R:A form.

String toString (  )  const

Get a String representation of the version, in C-A.A.R form.


The documentation for this class was generated from the following files:
Generated on Sat Nov 26 16:49:10 2011 for libcommonc++ by  doxygen 1.6.3