OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::VersionGraphCfg Class Reference

#include "VersionGraphCfg.h"

Inheritance diagram for ot::VersionGraphCfg:
ot::Serializable

Public Types

typedef std::list< VersionGraphVersionCfgVersionsList
 
typedef std::list< VersionsListBranchesList
 

Public Member Functions

 VersionGraphCfg ()
 
 VersionGraphCfg (const VersionGraphCfg &_other)=delete
 
 VersionGraphCfg (VersionGraphCfg &&_other) noexcept
 
virtual ~VersionGraphCfg ()
 
VersionGraphCfgoperator= (const VersionGraphCfg &_other)=delete
 
VersionGraphCfgoperator= (VersionGraphCfg &&_other) noexcept
 
virtual void addToJsonObject (ot::JsonValue &_object, ot::JsonAllocator &_allocator) const override
 Add the object contents to the provided JSON object.
 
virtual void setFromJsonObject (const ot::ConstJsonObject &_object) override
 Set the object contents from the provided JSON object.
 
void setActiveVersionName (const std::string &_version)
 
const std::string & getActiveVersionName (void) const
 Returns the active version name. The active version is the currently active model version.
 
void incrementActiveVersion (void)
 
void setActiveBranchName (const std::string &_version)
 
const std::string & getActiveBranchName (void) const
 Returns the active branch name. The active branch is the currently active branch. All parent versions of this version are in the active branch.
 
VersionGraphVersionCfginsertVersion (const std::string &_version, const std::string &_parentVersion, const std::string &_label=std::string(), const std::string &_description=std::string())
 
VersionGraphVersionCfginsertVersion (VersionGraphVersionCfg &&_version)
 
VersionsListinsertBranch (VersionsList &&_branch)
 
VersionGraphVersionCfgfindVersion (const std::string &_version)
 Returns the version with the given name.
 
const VersionGraphVersionCfgfindVersion (const std::string &_version) const
 Returns the version with the given name.
 
const VersionGraphVersionCfgfindLastVersion (void)
 Returns the last version in the active branch.
 
const VersionGraphVersionCfgfindLastVersion (const std::string &_branchName)
 Returns the last version in the specified branch.
 
const VersionGraphVersionCfgfindPreviousVersion (const std::string &_version) const
 Returns the previous version to the specified version.
 
const VersionGraphVersionCfgfindNextVersion (const std::string &_version) const
 Returns the next version to the specified version by taking the current branch into account.
 
const VersionGraphVersionCfgfindNextVersion (const std::string &_version, const std::string &_activeBranch) const
 
std::list< const VersionGraphVersionCfg * > findNextVersions (const std::string &_version, const std::string &_lastVersion)
 Returns a list containing all next versions. The resulting list will not contain the specified _version.
 
std::list< const VersionGraphVersionCfg * > findNextVersions (const std::string &_version, const std::string &_activeBranch, const std::string &_lastVersion)
 
std::list< const VersionGraphVersionCfg * > findAllNextVersions (const std::string &_version)
 Find all child versions of the specified versions.
 
bool versionIsEndOfBranch (const std::string &_version) const
 Returns true if the version is the last one in its branch. Will return false if the version does not exist or is not the last of its branch.
 
bool versionStartingWithNameExists (const std::string &_prefix)
 Returns true if a version with the given name prefix exists in any of the versions (Expensive).
 
void removeVersion (const std::string &_version)
 Removes the version and all of its childs if the version exists (Expensive).
 
bool getBranchExists (const std::string &_branchName) const
 
const std::list< std::list< VersionGraphVersionCfg > > & getBranches (void) const
 
int getBranchesCountFromNode (const std::string &_version) const
 Returns the number of branches that have the specified version as a branch node.
 
std::list< std::list< VersionGraphVersionCfg > > getBranchesFromNode (const std::string &_version) const
 Returns a list of direct branches that have the specified version as a branch node.
 
void clear (void)
 \breif Clear the version graph.
 
- Public Member Functions inherited from ot::Serializable
 Serializable ()
 
virtual ~Serializable ()
 

Static Public Member Functions

static std::string incrementVersion (const std::string &_version)
 
static VersionsListinsertBranch (VersionsList &&_branch, std::list< VersionsList > &_branchesList)
 

Member Typedef Documentation

◆ BranchesList

◆ VersionsList

Constructor & Destructor Documentation

◆ VersionGraphCfg() [1/3]

ot::VersionGraphCfg::VersionGraphCfg ( )

◆ VersionGraphCfg() [2/3]

ot::VersionGraphCfg::VersionGraphCfg ( const VersionGraphCfg & _other)
delete

◆ VersionGraphCfg() [3/3]

ot::VersionGraphCfg::VersionGraphCfg ( VersionGraphCfg && _other)
noexcept

◆ ~VersionGraphCfg()

ot::VersionGraphCfg::~VersionGraphCfg ( )
virtual

Member Function Documentation

◆ addToJsonObject()

void ot::VersionGraphCfg::addToJsonObject ( ot::JsonValue & _object,
ot::JsonAllocator & _allocator ) const
overridevirtual

Add the object contents to the provided JSON object.

Parameters
_objectJson object reference to write the data to.
_allocatorAllocator.

Implements ot::Serializable.

◆ clear()

void ot::VersionGraphCfg::clear ( void )

\breif Clear the version graph.

◆ findAllNextVersions()

std::list< const ot::VersionGraphVersionCfg * > ot::VersionGraphCfg::findAllNextVersions ( const std::string & _version)

Find all child versions of the specified versions.

◆ findLastVersion() [1/2]

const ot::VersionGraphVersionCfg * ot::VersionGraphCfg::findLastVersion ( const std::string & _branchName)

Returns the last version in the specified branch.

◆ findLastVersion() [2/2]

const ot::VersionGraphVersionCfg * ot::VersionGraphCfg::findLastVersion ( void )

Returns the last version in the active branch.

◆ findNextVersion() [1/2]

const ot::VersionGraphVersionCfg * ot::VersionGraphCfg::findNextVersion ( const std::string & _version) const

Returns the next version to the specified version by taking the current branch into account.

◆ findNextVersion() [2/2]

const ot::VersionGraphVersionCfg * ot::VersionGraphCfg::findNextVersion ( const std::string & _version,
const std::string & _activeBranch ) const

◆ findNextVersions() [1/2]

std::list< const ot::VersionGraphVersionCfg * > ot::VersionGraphCfg::findNextVersions ( const std::string & _version,
const std::string & _activeBranch,
const std::string & _lastVersion )

◆ findNextVersions() [2/2]

std::list< const ot::VersionGraphVersionCfg * > ot::VersionGraphCfg::findNextVersions ( const std::string & _version,
const std::string & _lastVersion )

Returns a list containing all next versions. The resulting list will not contain the specified _version.

Parameters
_versionThe version to start searching from.
_lastVersionThe last version to add to the list. Versions after that will be ignored.

◆ findPreviousVersion()

const ot::VersionGraphVersionCfg * ot::VersionGraphCfg::findPreviousVersion ( const std::string & _version) const

Returns the previous version to the specified version.

◆ findVersion() [1/2]

ot::VersionGraphVersionCfg * ot::VersionGraphCfg::findVersion ( const std::string & _version)

Returns the version with the given name.

◆ findVersion() [2/2]

const ot::VersionGraphVersionCfg * ot::VersionGraphCfg::findVersion ( const std::string & _version) const

Returns the version with the given name.

◆ getActiveBranchName()

const std::string & ot::VersionGraphCfg::getActiveBranchName ( void ) const
inline

Returns the active branch name. The active branch is the currently active branch. All parent versions of this version are in the active branch.

◆ getActiveVersionName()

const std::string & ot::VersionGraphCfg::getActiveVersionName ( void ) const
inline

Returns the active version name. The active version is the currently active model version.

◆ getBranches()

const std::list< std::list< VersionGraphVersionCfg > > & ot::VersionGraphCfg::getBranches ( void ) const
inline

◆ getBranchesCountFromNode()

int ot::VersionGraphCfg::getBranchesCountFromNode ( const std::string & _version) const

Returns the number of branches that have the specified version as a branch node.

◆ getBranchesFromNode()

std::list< std::list< ot::VersionGraphVersionCfg > > ot::VersionGraphCfg::getBranchesFromNode ( const std::string & _version) const

Returns a list of direct branches that have the specified version as a branch node.

◆ getBranchExists()

bool ot::VersionGraphCfg::getBranchExists ( const std::string & _branchName) const

◆ incrementActiveVersion()

void ot::VersionGraphCfg::incrementActiveVersion ( void )

◆ incrementVersion()

std::string ot::VersionGraphCfg::incrementVersion ( const std::string & _version)
static

◆ insertBranch() [1/2]

ot::VersionGraphCfg::VersionsList & ot::VersionGraphCfg::insertBranch ( VersionsList && _branch)

◆ insertBranch() [2/2]

ot::VersionGraphCfg::VersionsList & ot::VersionGraphCfg::insertBranch ( VersionsList && _branch,
std::list< VersionsList > & _branchesList )
static

◆ insertVersion() [1/2]

ot::VersionGraphVersionCfg & ot::VersionGraphCfg::insertVersion ( const std::string & _version,
const std::string & _parentVersion,
const std::string & _label = std::string(),
const std::string & _description = std::string() )

◆ insertVersion() [2/2]

ot::VersionGraphVersionCfg & ot::VersionGraphCfg::insertVersion ( VersionGraphVersionCfg && _version)

◆ operator=() [1/2]

VersionGraphCfg & ot::VersionGraphCfg::operator= ( const VersionGraphCfg & _other)
delete

◆ operator=() [2/2]

ot::VersionGraphCfg & ot::VersionGraphCfg::operator= ( VersionGraphCfg && _other)
noexcept

◆ removeVersion()

void ot::VersionGraphCfg::removeVersion ( const std::string & _version)

Removes the version and all of its childs if the version exists (Expensive).

◆ setActiveBranchName()

void ot::VersionGraphCfg::setActiveBranchName ( const std::string & _version)
inline

◆ setActiveVersionName()

void ot::VersionGraphCfg::setActiveVersionName ( const std::string & _version)
inline

◆ setFromJsonObject()

void ot::VersionGraphCfg::setFromJsonObject ( const ot::ConstJsonObject & _object)
overridevirtual

Set the object contents from the provided JSON object.

Parameters
_objectThe JSON object containing the information.
Exceptions
Maythrow an exception if the provided object is not valid (members missing or invalid types).

Implements ot::Serializable.

◆ versionIsEndOfBranch()

bool ot::VersionGraphCfg::versionIsEndOfBranch ( const std::string & _version) const

Returns true if the version is the last one in its branch. Will return false if the version does not exist or is not the last of its branch.

◆ versionStartingWithNameExists()

bool ot::VersionGraphCfg::versionStartingWithNameExists ( const std::string & _prefix)

Returns true if a version with the given name prefix exists in any of the versions (Expensive).


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