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

#include "VersionGraphCfg.h"

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

Public Member Functions

 VersionGraphCfg ()
 
 VersionGraphCfg (const VersionGraphCfg &_other)=delete
 
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 setActiveBranchVersionName (const std::string &_version)
 
const std::string & getActiveBranchVersionName (void) const
 Returns the active branch version name. The active branch version is the currently active branch. All parent versions of this version are in the active branch. The first child a version in an active branch belongs to the active branch (after the active branch version, parent versions are handled by the parent).
 
void setRootVersion (const std::string &_name, const std::string &_label=std::string(), const std::string &_description=std::string())
 
void setRootVersion (VersionGraphVersionCfg *_version)
 Set the provided version as the root version. The current root version will be.
 
VersionGraphVersionCfggetRootVersion (void)
 Returns the root version. The VersionGraphCfg keeps ownership of the version.
 
const VersionGraphVersionCfggetRootVersion (void) const
 Returns the root version. The VersionGraphCfg keeps ownership of the version.
 
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.
 
bool versionStartingWithNameExists (const std::string &_prefix)
 Returns true if a version with the given name prefix exists in any of the versions.
 
void removeVersion (const std::string &_version)
 Removes the version and all of its childs if the version exists.
 
void clear (void)
 \breif Clear the version graph.
 
- Public Member Functions inherited from ot::Serializable
 Serializable ()
 
virtual ~Serializable ()
 

Constructor & Destructor Documentation

◆ VersionGraphCfg() [1/2]

ot::VersionGraphCfg::VersionGraphCfg ( )

◆ VersionGraphCfg() [2/2]

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

◆ ~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.

◆ 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.

◆ getActiveBranchVersionName()

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

Returns the active branch version name. The active branch version is the currently active branch. All parent versions of this version are in the active branch. The first child a version in an active branch belongs to the active branch (after the active branch version, parent versions are handled by the parent).

◆ getActiveVersionName()

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

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

◆ getRootVersion() [1/2]

VersionGraphVersionCfg * ot::VersionGraphCfg::getRootVersion ( void )
inline

Returns the root version. The VersionGraphCfg keeps ownership of the version.

◆ getRootVersion() [2/2]

const VersionGraphVersionCfg * ot::VersionGraphCfg::getRootVersion ( void ) const
inline

Returns the root version. The VersionGraphCfg keeps ownership of the 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.

◆ setActiveBranchVersionName()

void ot::VersionGraphCfg::setActiveBranchVersionName ( 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.

◆ setRootVersion() [1/2]

void ot::VersionGraphCfg::setRootVersion ( const std::string & _name,
const std::string & _label = std::string(),
const std::string & _description = std::string() )

◆ setRootVersion() [2/2]

void ot::VersionGraphCfg::setRootVersion ( VersionGraphVersionCfg * _version)

Set the provided version as the root version. The current root version will be.

◆ 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.


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