libqasm
library for handling cQASM files
Public Member Functions | List of all members
cqasm::version::Version Class Reference

Version number primitive used within the AST and semantic trees. More...

Public Member Functions

 Version (const std::string &version="1.0")
 Constructs a version object from a string, defaulting to 1.0. More...
 
int compare (const Version &other) const
 Compares this version against the other version. More...
 
int compare (const std::string &other) const
 Compares this version against the other version. More...
 

Detailed Description

Version number primitive used within the AST and semantic trees.

Definition at line 22 of file cqasm-version.hpp.

#include <cqasm-version.hpp>

Inheritance diagram for cqasm::version::Version:
Inheritance graph
[legend]
Collaboration diagram for cqasm::version::Version:
Collaboration graph
[legend]

Constructor & Destructor Documentation

◆ Version()

cqasm::version::Version::Version ( const std::string &  version = "1.0")
explicit

Constructs a version object from a string, defaulting to 1.0.

Definition at line 16 of file cqasm-version.cpp.

Member Function Documentation

◆ compare() [1/2]

int cqasm::version::Version::compare ( const Version other) const

Compares this version against the other version.

Returns 1 if this version is newer than the other, returns -1 if this version is older than the other, or returns 0 if both versions are the same. When there is a mismatch in the number of components between the versions, missing components are interpreted as 0.

Definition at line 40 of file cqasm-version.cpp.

◆ compare() [2/2]

int cqasm::version::Version::compare ( const std::string &  other) const

Compares this version against the other version.

Returns 1 if this version is newer than the other, returns -1 if this version is older than the other, or returns 0 if both versions are the same. When there is a mismatch in the number of components between the versions, missing components are interpreted as 0.

Definition at line 57 of file cqasm-version.cpp.


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