Version

Functions

Version

Version

~Version

PRODUCT

GetProduct

HOST_PRODUCT

GetHostProduct

unsigned int

GetMinor

unsigned int

GetMajor

unsigned int

GetBranch

const char *

GetBuild

bool

operator==

bool

operator

bool

operator

String

ToString

Version

FromString

Detailed Description

class Version

This class defines a generic version object for product version management.

A version object is made of:

  • a product identifier

  • a host product description (for plug-ins)

  • a major version number

  • a minor version number

  • a build number

Each product must have its own version object to allow compatibility checks and easy customers support.

The current REDsdk version is accessed from the RED::ILicense interface, using the RED::ILicense::GetSDKVersion method.

Public Functions

Version()

Default constructor.

Version(RED::PRODUCT iProduct, RED::HOST_PRODUCT iHostProduct, unsigned int iMajor, unsigned int iMinor, unsigned int iBranch, const char *iBuild)

Build a Version object.

Parameters
  • iProduct – Number identifying the product.

  • iHostProduct – Host product description.

  • iMajor – Major version number.

  • iMinor – Minor version number.

  • iBranch – Source code branch.

  • iBuild – Build number.

virtual ~Version()

Destructor.

inline RED::PRODUCT GetProduct() const
Returns

The product alias.

inline RED::HOST_PRODUCT GetHostProduct() const
Returns

The host product description.

inline unsigned int GetMinor() const
Returns

The minor part of a product verion.

inline unsigned int GetMajor() const
Returns

The major part of a product verion.

inline unsigned int GetBranch() const
Returns

The code branch number of a product verion.

inline const char *GetBuild() const
Returns

The build number of a product verion.

bool operator==(const Version &iOther) const

Equality test operator.

Two versions are considered as equals if their minor, major and build members all are identical.

Parameters

iOtherVersion to test with.

bool operator<(const Version &iOther) const

Anteriority test operator.

The test is performed only on the _minor, _major and _build members of the version objects (the _buildname member is ignored). If the three members are equals, the test returns false.

Parameters

iOtherVersion to test with.

Returns

true if the test has succeeded, false otherwise.

inline bool operator<=(const Version &iOther) const

Relaxed anteriority test operator.

The test is performed only on the _minor, _major and _build members of the version objects (the _buildname member is ignored).

Parameters

iOtherVersion to test with.

Returns

true if the test has succeeded, false otherwise.

RED::String ToString() const

Returns a string representation of the object.

Helpful to serialize version objects. Object members are separated by ‘$’ chars in the output string.

Returns

a string representation of the object.

Public Static Functions

static RED::Version FromString(const RED::String &iString)

Constructs a version object from a string.

See RED::Version::ToString for further details.

Parameters

iString – string containing the serialized representation of a version object.

Returns

the newly created version object.