Skip to main content

System Coupling C++ library 2025 R1

Attribute

Last update: 17.07.2025
1 /*
2  * Copyright ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited.
3  */
4 
5 #pragma once
6 
7 #include "SystemCouplingParticipant/LibraryType.hpp"
8 
9 #include "SystemCouplingParticipant/CommonTypes.hpp"
10 
11 #include <cstdint>
12 
13 namespace sysc {
14 
23 class SYSTEM_COUPLING_PARTICIPANT_DLL RealAttribute {
24 public:
35  AttributeName name,
36  double value,
37  Dimensionality dimensionality);
38 
52  AttributeName name,
53  double value,
54  Dimensionality dimensionality,
55  bool modifiable);
56 
57  const AttributeName& getName() const noexcept;
58 
59  double getValue() const noexcept;
60 
61  const Dimensionality& getDimensionality() const noexcept;
62 
63  bool isModifiable() const noexcept;
64 
65  std::string getUnits() const;
66 
67 private:
68  AttributeName m_name;
69  double m_value{0.0};
70  Dimensionality m_dimensionality;
71  bool m_modifiable{true};
72 };
73 
82 class SYSTEM_COUPLING_PARTICIPANT_DLL IntegerAttribute {
83 public:
93  AttributeName name,
94  std::int64_t value);
95 
106  AttributeName name,
107  std::int64_t value,
108  bool modifiable);
109 
110  const AttributeName& getName() const noexcept;
111 
112  std::int64_t getValue() const noexcept;
113 
114  bool isModifiable() const noexcept;
115 
116 private:
117  AttributeName m_name;
118  std::int64_t m_value{0};
119  bool m_modifiable{true};
120 };
121 
122 } // namespace sysc
Provide a class for an integer-valued attribute.
Definition: Attribute.hpp:82
IntegerAttribute(AttributeName name, std::int64_t value, bool modifiable)
Provide a constructor for the IntegerAttribute class.
IntegerAttribute(AttributeName name, std::int64_t value)
Provide a constructor for the IntegerAttribute class.
Provide a class for a real-valued attribute.
Definition: Attribute.hpp:23
RealAttribute(AttributeName name, double value, Dimensionality dimensionality, bool modifiable)
Provide a constructor for the RealAttribute class.
RealAttribute(AttributeName name, double value, Dimensionality dimensionality)
Provide a constructor for the RealAttribute class.
std::string AttributeName
Provide a structure for dimensionality.

Connect with Ansys