libbmq  a5f8a06ba1d16cb5a65643e1fa7f1a1d6aadef40
bmqt_version.h File Reference

Provide a value-semantic type representing a version (major minor). More...

#include <bsl_iosfwd.h>

Go to the source code of this file.

Classes

class  BloombergLP::bmqt::Version
 A version consisting of a major and minor version number. More...
 

Namespaces

 BloombergLP
 
 BloombergLP::bmqt
 

Functions

bsl::ostream & BloombergLP::bmqt::operator<< (bsl::ostream &stream, const Version &rhs)
 
bool BloombergLP::bmqt::operator== (const Version &lhs, const Version &rhs)
 
bool BloombergLP::bmqt::operator!= (const Version &lhs, const Version &rhs)
 
bool BloombergLP::bmqt::operator< (const Version &lhs, const Version &rhs)
 

Detailed Description

This component implements a simple value-semantic type, bmqt::Version representing the version of an object. It is used in particular to attach a version attribute to a bmqa::Message, so that a consuming application receiving a message knows the version of the schema that was used for publishing.

A version is represented by two numbers: a major and a minor version. Both are positive integers within the range [0-255].

Usage Example

bmqt::Version version(1, 3);
BSLS_ASSERT(version.major() == 1);
BSLS_ASSERT(version.minor() == 3);
version.setMajor(2).setMinor(4);
BSLS_ASSERT(version.major() == 2);
BSLS_ASSERT(version.minor() == 4);