GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 1 / 1 / 2
Functions: 100.0% 1 / 1 / 2
Branches: -% 0 / 1 / 1

src/model/ComponentData_Impl.hpp
Line Branch Exec Source
1 /***********************************************************************************************************************
2 * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC.
3 * See also https://openstudio.net/license
4 ***********************************************************************************************************************/
5
6 #ifndef MODEL_COMPONENTDATA_IMPL_HPP
7 #define MODEL_COMPONENTDATA_IMPL_HPP
8
9 #include "ComponentData.hpp"
10
11 #include "ResourceObject_Impl.hpp"
12
13 namespace openstudio {
14 namespace model {
15
16 namespace detail {
17
18 class MODEL_API ComponentData_Impl : public ResourceObject_Impl
19 {
20
21 public:
22 /** @name Constructors and Destructors */
23 //@{
24
25 // constructor
26 ComponentData_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
27
28 // construct from workspace
29 ComponentData_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
30
31 // copy constructor
32 ComponentData_Impl(const ComponentData_Impl& other, Model_Impl* model, bool keepHandle);
33
34 // virtual destructor
35 872 virtual ~ComponentData_Impl() override = default;
36
37 //@}
38 /** @name Virtual Methods */
39 //@{
40
41 // Get all output variable names that could be associated with this object.
42 virtual const std::vector<std::string>& outputVariableNames() const override;
43
44 virtual IddObjectType iddObjectType() const override;
45
46 //@}
47 /** @name Getters */
48 //@{
49
50 UUID uuid() const;
51
52 UUID versionUUID() const;
53
54 boost::optional<int> creationTimestamp() const;
55
56 boost::optional<int> versionTimestamp() const;
57
58 /** Equivalent to getComponentObject(0). */
59 ModelObject primaryComponentObject() const;
60
61 std::vector<ModelObject> componentObjects() const;
62
63 /** Throws if objectIndex >= numComponentObjects, or if ComponentData has been corrupted. */
64 ModelObject getComponentObject(unsigned objectIndex) const;
65
66 //@}
67 /** @name Setters */
68 //@{
69
70 UUID createVersionUUID();
71
72 /** Pushes a new extensible group containing object's data. Not exposed in the public
73 * interface. Use with care. */
74 bool registerObject(const ModelObject& object);
75
76 //@}
77 /** @name Queries */
78 //@{
79
80 /** Returns the number of objects in the Component described by this object. Must be >= 1. */
81 unsigned numComponentObjects() const;
82
83 //@}
84 private:
85 − REGISTER_LOGGER("openstudio.model.ComponentData");
86
87 boost::optional<ModelObject> primaryComponentObjectAsModelObject() const;
88 };
89
90 } // namespace detail
91
92 } // namespace model
93 } // namespace openstudio
94
95 #endif // MODEL_COMPONENTDATA_IMPL_HPP
96