OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
VersionGraphVersionCfg.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
10#include "OTCore/Serializable.h"
12
13// std header
14#include <list>
15#include <vector>
16#include <string>
17
18#pragma warning(disable:4251)
19
20namespace ot {
21
22 class VersionGraphCfg;
23
25 public:
26#ifdef OT_OS_64Bit
27 typedef long long VersionNumberType;
28#else
29 typedef long VersionNumberType;
30#endif
31
32 static VersionGraphVersionCfg createBranchNodeFromBranch(const std::string& _branch);
33
37 VersionGraphVersionCfg(const std::string& _versionName, const std::string& _label = std::string(), const std::string& _description = std::string());
41
42 VersionGraphVersionCfg& operator = (const VersionGraphVersionCfg& _other);
43 VersionGraphVersionCfg& operator = (VersionGraphVersionCfg&& _other) noexcept;
44
46 bool operator == (const std::string& _name) const;
47
49 bool operator != (const std::string& _name) const;
50
51 void addToJsonObject(ot::JsonValue& _object, ot::JsonAllocator& _allocator) const override;
52
53 void setFromJsonObject(const ot::ConstJsonObject& _object) override;
54
56 void setName(const std::string& _name) { m_name = _name; };
57
67 const std::string& getName(void) const { return m_name; };
68
71 std::string getBranchName(void) const;
72
75 std::string getBranchNodeName(void) const;
76
78 void setLabel(const std::string& _title) { m_label = _title; };
79
82 const std::string& getLabel(void) const { return m_label; };
83
84 void setDescription(const std::string& _description) { m_description = _description; };
85 const std::string& getDescription(void) const { return m_description; };
86
87 void setParentVersion(const std::string& _version) { m_parentVersion = _version; };
88 const std::string& getParentVersion(void) const { return m_parentVersion; };
89
91 void setDirectParentIsHidden(bool _isHidden) { m_directParentIsHidden = _isHidden; };
92
94 bool getDirectParentIsHidden(void) const { return m_directParentIsHidden; };
95
97 VersionNumberType getVersionNumber(void) const { return VersionGraphVersionCfg::getVersionNumber(m_name); };
98
102 static VersionNumberType getVersionNumber(const std::string& _version);
103
104 std::vector<VersionNumberType> getVersionNumbers(void) const;
105 static std::vector<VersionNumberType> getVersionNumbers(const std::string& _version);
106
107 bool isValid(void) const;
108
110 static bool isValid(const std::string& _versionName);
111
112 bool isOnActivePath(const std::string& _activeBranchName) const;
113
114 static bool isOnActivePath(const std::string& _versionName, const std::string& _activeBranchName);
115
116 private:
117 std::string m_name;
118 std::string m_label;
119 std::string m_description;
120 std::string m_parentVersion;
121 bool m_directParentIsHidden;
122 };
123
124}
The ArchitectureInfo contains multiple definitions that specify the current OS architecture.
bool operator==(const FaceSelection &left, const FaceSelection &right)
Definition Model.cpp:55
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
The Serializable class is the default interface of serializable objects.
Definition Serializable.h:17
Definition VersionGraphVersionCfg.h:24
void setDirectParentIsHidden(bool _isHidden)
Definition VersionGraphVersionCfg.h:91
void setLabel(const std::string &_title)
Definition VersionGraphVersionCfg.h:78
VersionNumberType getVersionNumber(void) const
getVersionNumber
Definition VersionGraphVersionCfg.h:97
void setName(const std::string &_name)
Definition VersionGraphVersionCfg.h:56
long VersionNumberType
Definition VersionGraphVersionCfg.h:29
bool getDirectParentIsHidden(void) const
If the direct parent is hidden the connection line will be displayed as a dashed line.
Definition VersionGraphVersionCfg.h:94
const std::string & getDescription(void) const
Definition VersionGraphVersionCfg.h:85
const std::string & getName(void) const
Returns the version name. The name is used to identify the version in a graph. The name will be displ...
Definition VersionGraphVersionCfg.h:67
const std::string & getParentVersion(void) const
Definition VersionGraphVersionCfg.h:88
void setDescription(const std::string &_description)
Definition VersionGraphVersionCfg.h:84
void setParentVersion(const std::string &_version)
Definition VersionGraphVersionCfg.h:87
const std::string & getLabel(void) const
Returns the version label. The label will be displayed on the version if it is not empty.
Definition VersionGraphVersionCfg.h:82
Definition Connector.h:8
rapidjson::Value JsonValue
Writable JSON value.
Definition JSON.h:27
rapidjson::GenericObject< true, rapidjson::GenericValue< rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > > > ConstJsonObject
Read only JSON Object.
Definition JSON.h:35
rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > JsonAllocator
Allocator used for writing to JSON values.
Definition JSON.h:30